Hi Simon,

I have a Facelets function wich will act on the server side:
  - each user will be able to have its rows in database for specifying the
pattern he want to have for a given id

For example let's say the pattern is simply an el expression:
  whan I use my facelets tag xx:link it gets the id of the tc:link element
it contains and passes it to the facelets function. This one gets the
corresponding el expression and returns the resulting string of
itf:toString(contract.client, *'correspondingEl'*
**
where correspondingEl is for example: "#{client.lastName} entred: #{
client.entryDate}" for the user1
and "#{client.lastName} sponsored #{client.sponsored.size}" for user2, both
expressions will be in database under the key : "JSF id of the link"

For me it's important that this happens as transparently as using a standard
tag. The content of the template tag can contain js code naturally, but it
inspects alone the id of its content.

Regards,
Zied



2007/10/8, Zied Hamdi <[EMAIL PROTECTED]>:
>
> 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 <[EMAIL PROTECTED]>:
> >
> >  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
> >
>
>
>
> --
> Zied Hamdi
> zatreex.sourceforge.net




-- 
Zied Hamdi
zatreex.sourceforge.net

Reply via email to