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:[EMAIL PROTECTED] 
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

Reply via email to