RE: Loop and javascript
The generated code anyway won’t show t:id.. but if I give id instead of t:id, it trats it as css id and the generated html would have automatically generated id by tapestry instead of the id given by us in id=”${}” Warm Regards, Ashutosh Soman From: Thiago H. de Paula Figueiredo [via Tapestry] [mailto:ml-node+4619581-11006814-233...@n5.nabble.com] Sent: Thursday, July 21, 2011 7:55 PM To: Ashutosh, Soman Subject: Re: Loop and javascript On Thu, 21 Jul 2011 10:53:00 -0300, Ashutosh, Soman [hidden email] wrote: Hi!! Hi! As mentioned above, I tried using id=${} instead of t:id, but the function getElementbyId() returns element based on t:id and not id This isn't true. Check the generated HTML and the post it here. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] If you reply to this email, your message will be added to the discussion below: http://tapestry.1045711.n5.nabble.com/Loop-and-javascript-tp4618424p4619581.html To unsubscribe from Loop and javascript, click here http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4618424code=U29tYW4uQXNodXRvc2hAYXRvcy5uZXR8NDYxODQyNHwtOTMxODc4NjY3 . This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Loop-and-javascript-tp4618424p4621991.html Sent from the Tapestry - User mailing list archive at Nabble.com.
RE: Loop and javascript
Hi! the same works for checkboxes. It takes t:clientId as id when generating html. But in case of radio buttons with radiogroup, it takes auto generated id unless you specify one in t:id. Ashutosh -- View this message in context: http://tapestry.1045711.n5.nabble.com/Loop-and-javascript-tp4618424p4622407.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Loop and javascript
Hi, I need to use javascript in a loop which uses t:id of an element(a radio button). The javascript in an onclick event on another element(an image). But since tapestry is not allowing me to put t:id in t:id=${} this fashion, i'm facing problem. Basically what i want to do is check corresponding radio button when clicked on an image. But since i need to use t:loop, i'm not able to access proper id through javascript for that. Please suggest how can i do it or is there any better way to do it? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Loop-and-javascript-tp4618424p4618424.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Loop and javascript
Use a mixin. They allow you to get the autogenerated Tapestry ids and pass those to javascript. Or you can change your javascript to use event.target instead of the id. That will let you know what image was clicked, and then you can traverse the dom for the nearest radiobutton. -- View this message in context: http://tapestry-users.832.n2.nabble.com/Loop-and-javascript-tp6606437p6606626.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Loop and javascript
On Thu, 21 Jul 2011 04:31:43 -0300, ashu.soman soman.ashut...@atos.net wrote: Hi, Hi! I need to use javascript in a loop which uses t:id of an element(a radio button). The javascript in an onclick event on another element(an image). But since tapestry is not allowing me to put t:id in t:id=${} this fashion, i'm facing problem. t:id is the Tapestry component instance id in the template. Tapestry pages and components have strictly static structure and very dynamic behavior. What you need to do is using id=${}, not t:id. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Loop and javascript
Hi!! As mentioned above, I tried using id=${} instead of t:id, but the function getElementbyId() returns element based on t:id and not id which I tried and experimented with for quite some time now. And sadly, t:id soesn't accept ${} types of values, it needs to be hardcoded. Warm Regards, Ashutosh Soman ODC-AWL | Vikhroli, Mumbai | : soman.ashut...@atosorigin.com | :+91 22 6733 3729 | :(M): +91 9769058194 -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: Thursday, July 21, 2011 7:14 PM To: users@tapestry.apache.org; Ashutosh, Soman Subject: Re: Loop and javascript On Thu, 21 Jul 2011 04:31:43 -0300, ashu.soman soman.ashut...@atos.net wrote: Hi, Hi! I need to use javascript in a loop which uses t:id of an element(a radio button). The javascript in an onclick event on another element(an image). But since tapestry is not allowing me to put t:id in t:id=${} this fashion, i'm facing problem. t:id is the Tapestry component instance id in the template. Tapestry pages and components have strictly static structure and very dynamic behavior. What you need to do is using id=${}, not t:id. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Loop and javascript
On Thu, 21 Jul 2011 10:53:00 -0300, Ashutosh, Soman soman.ashut...@atos.net wrote: Hi!! Hi! As mentioned above, I tried using id=${} instead of t:id, but the function getElementbyId() returns element based on t:id and not id This isn't true. Check the generated HTML and the post it here. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Loop in javascript?
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. smime.p7s Description: S/MIME Cryptographic Signature
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. smime.p7s Description: S/MIME Cryptographic Signature
Re: Loop in javascript?
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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org