You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nicolaas geldenhuys <ni...@cartrack.co.za> on 2005/04/14 16:12:44 UTC

Re: How to generate unique names of an AbstractComponent within Foreach

Hi Shing

I am no expert but perhaps http://www.t-deli.com/ can help.

It looks like the Alternative base components can detect if they are in
a form of not.

Do not know if this will help.

Nicolaas


On Thu, 2005-04-14 at 14:42 +0100, Shing Hing Man wrote:
> Dear all,
>   I am trying to make my tooltip component work in a
> Foreach component. 
> When a tooltip component is inside a Foreach
> component, 
> I would like Tapestry  to generate a unique (html)
> name for  each 
> copy of my tooltip component. (At present, the
> generated name 
> is the same for each copy.)
> This is possible for form components.
> 
> For example, take a TextField component inside a
> Foreach component.
> Each TextField will be given a  unique (html) name
> like (Component name of TextField)$0,    
> (Component name of TextField)$1, ...., etc.
> If I am not mistaken, the unique name is generated 
> by the method IForm.getElementId(IFormComponent
> component).
> 
> This  trick is no good to me because my tooltip
> component only 
> extends AbstractComponent and will be used inside as
> well as outside a form.
> 
> Does anyone know how to generate a unqiue name 
> of an AbstractComponent within Foreach ?
> (Of course, I could achieve this manually by appending
> 
> a timestamp,say,  to the component name. This is
> ugly.)
> 
> Thanks in advance for any suggestions !
> 
> Shing   
> 
> 
> 
> Home page :
>   http://uk.geocities.com/matmsh/index.html
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org