You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christine <ch...@christine.nl> on 2009/05/05 17:58:45 UTC

Loop in javascript?

Hi,

I'd like to iterate an ArrayList() in my java file from within 
javascript in the tpl file. It seems that Loop only works as part of an 
html tag. Is there a way I can have javascript loop over an ArrayList() ?

dagdag
Christine

-- 
dagdag is just a two-character rotation of byebye.


Re: Loop in javascript?

Posted by Christine <ch...@christine.nl>.
Thiago H. de Paula Figueiredo wrote:
> One way of doing it: in your page or component class, @Inject
> RenderSupport and generate Javascript through
> RenderSupport.addScript().
I made the loop in javascript, then added an Ajax.Request to get json 
data from an onEvent in my component. The ajax request sends an index 
which gives it the appropirate element from a List. I use it to put 
markers on a Google map that's created in my tml file.

A friend helped me figure it out :-)

dagdag
Christine

- 
dagdag is just a two-character rotation of byebye.


Re: Loop in javascript?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
One way of doing it: in your page or component class, @Inject
RenderSupport and generate Javascript through
RenderSupport.addScript().

-- 
Thiago

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