You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Faneyte, Diego" <di...@wur.nl> on 2004/08/16 16:31:44 UTC

Getting id of component in Block

Hello,

I am having trouble getting the id of a component that is placed in a Block component.

The setup is like this: There is a page with a Block that contains a TextField.
Withing a form (with submit button) there is a foreach loop that contains a RenderBlock. A number of blocks are inserted into the page.

Now when the submit button is pressed I want to access the values of the textfields but i don't have the id's of the TextFields that where inserted by the RenderBlock.

if i look at the generated HTML in my browser is see the textfield from the block are named $TextField, $TextField$0, $TextField$1. But how do i access the values from my code? 

regards,
Diego

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


Re: Getting id of component in Block

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Perhaps you should be binding your text fields to values that you have 
implicit access to after the submit.

I created a large page of tons of @Block's that get rendered through a 
@Foreach just as you described and bind directly into objects with no 
problems.  In other words, you should not need direct access to the 
components by id.

	Erik

On Aug 16, 2004, at 10:31 AM, Faneyte, Diego wrote:

> Hello,
>
> I am having trouble getting the id of a component that is placed in a 
> Block component.
>
> The setup is like this: There is a page with a Block that contains a 
> TextField.
> Withing a form (with submit button) there is a foreach loop that 
> contains a RenderBlock. A number of blocks are inserted into the page.
>
> Now when the submit button is pressed I want to access the values of 
> the textfields but i don't have the id's of the TextFields that where 
> inserted by the RenderBlock.
>
> if i look at the generated HTML in my browser is see the textfield 
> from the block are named $TextField, $TextField$0, $TextField$1. But 
> how do i access the values from my code?
>
> regards,
> Diego
>
> ---------------------------------------------------------------------
> 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