You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andreas Bohnert <ab...@online.de> on 2004/03/08 18:20:06 UTC

how to reference a component, if you don't know the name?

hi tapestry list,

I have a form with a component inside. this component has a foreach loop 
to generate multiple textarea components.
Tapestry assigns a unique name for each textarea component inside that loop.
so far so good.
inside my component I need to reference each textarea component.
if I have just one component I could assume the following:

textarea[0] = (TextArea)getComponent("$TextArea");
textarea[1] = (TextArea)getComponent("$TextArea$0");
.
.
.
but this is not really nice, especially if I have more than one of this 
components inside my form.
I tried getComponents() and analyzed the map, but I just get one 
TextArea entry even if I have generated 2 Textarea's during the loop.

so, what's the best way to handle this?

thanks for any advice
andreas


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