myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zied Hamdi" <javaha...@gmail.com>
Subject Re: [JSF] and maybe [+obago] : how to get the id of the current element to pass it to a function
Date Mon, 08 Oct 2007 14:46:42 GMT
Hi Mario,

Thanks!!! that's great to know. I'll try to search the document for xxxx and
replace with the element id.

Though I prefer to let this solution as the no solution approch, In fact I
planned to do my own xx:link and xx:label that gets its own id and pass it
transaparently with no impact on the owning page...

Anyway it's a great thing to know in general.

Regards,
Zied


2007/10/8, Schröder, Mario <mario.schroeder@saxsys.de>:
>
>  Hi Zied,
>
>
>
> I think the tag <tc:script/> is the solution. It has several attributes
> like "onload" or "onexit". You should place it inside <tc:page>. Here a
> skeleton:
>
>
>
> <f:view>
>
>  <script language="javascript">
>
>             function doIt(){
>
>                         alert("Welcome");
>
>             }
>
>  </script>
>
>  <tc:page>
>
>   <tc:script onload="doIt()"/>
>
>   …your content…
>
>  </tc:page>
>
> </f:view>
>
>
>
> Hope it helps.
>
>
>
> Regards, Mario
>
>
>  ------------------------------
>
> *Von:* Zied Hamdi [mailto:javahamdi@gmail.com]
> *Gesendet:* Montag, 8. Oktober 2007 16:05
> *An:* MyFaces
> *Betreff:* [JSF] and maybe [+obago] : how to get the id of the current
> element to pass it to a function
>
>
>
> Hi Tobago friends,
>
>
>
> I have a question for all JSF users (th'at's why I wrote +obago for those
> who have filters). I'd like to let each user choose what he wants displayed
> in his/her label and link fields. So I wrote a function that I'd like to
> call this way for example:
>
>
>
>              <tc:column >
>
>                   < tc:link label ="#{itf:toString(contract.client, *'**
> xxxx**'* )}"></ tc:link>
>
>             </tc:column >
>
>
>
>
>
> Where I'd like to have in xxxx the id of the current element.  Does anyone
> have a solution to insert it automatically through javascript or an el
> expression?
>
>
>
> I think javascript could be a good candidte sth like
>
>
>
> function( tag ) {
>
>   return tag.id;
>
> }
>
>
>
> But I'm really bad in js, I don't know when it gets called, how to call it
> to fill in the value at page load, and fetures like that...
>
>
>
> I'd be very happy if someone can help.
>
>
>
> Cheers and folks,
>
> Zied
>



-- 
Zied Hamdi
zatreex.sourceforge.net

Mime
View raw message