You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jiju <ji...@ibsplc.com> on 2006/12/15 05:29:52 UTC

refer For loop components using javascript

Using javascript I have to access n'th textfield html objects rendered using
for Loop component. 
But the name & ids are generated dynamically by Tapestry,its not possible to
access a particular textfield.

But in the case of struts it will render all the loop elements with the same
name, we can access it as an array
say : document.forms[0].contact[2].value;

is there any workaround to solve it ? or i have missed any parameter setting

I can use @Any component to create textfield with myown names ,but it won't
rewind 
-- 
View this message in context: http://www.nabble.com/refer-For-loop-components-using-javascript-tf2825114.html#a7886093
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: refer For loop components using javascript

Posted by Jesse Kuhnert <jk...@gmail.com>.
Not surprising to hear about struts doing something like that. Naughty
naughty struts developers....

You will probably have better luck writing whatever javascript you are
writing using a javascript template. Within the template you can call
whatever component methods you want. (like getClientId(), which is the
globally unique id by which you can find it on the page by calling
document.getElementById("string") )

http://tapestry.apache.org/tapestry4.1/usersguide/script.html

You can also use an Insert component to get the clientId but that sounds messy.

On 12/14/06, jiju <ji...@ibsplc.com> wrote:
>
> Using javascript I have to access n'th textfield html objects rendered using
> for Loop component.
> But the name & ids are generated dynamically by Tapestry,its not possible to
> access a particular textfield.
>
> But in the case of struts it will render all the loop elements with the same
> name, we can access it as an array
> say : document.forms[0].contact[2].value;
>
> is there any workaround to solve it ? or i have missed any parameter setting
>
> I can use @Any component to create textfield with myown names ,but it won't
> rewind
> --
> View this message in context: http://www.nabble.com/refer-For-loop-components-using-javascript-tf2825114.html#a7886093
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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