This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Javascript accessing Arraylist of the form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Javascript accessing Arraylist of the form" Watch "Javascript accessing Arraylist of the form" New topic
Author

Javascript accessing Arraylist of the form

Sachin Ag
Greenhorn

Joined: Sep 15, 2010
Posts: 5
Hello

I have an arraylist of objects and am using logic:iterate on the jsp page to display the table contents dynamically. My object has 3 fields, one checked variable for checkbox, one description and one value. What i want is that when submit button is clicked, then in javascript i need to do some validations. In javascript i want to get all the checkbox selected in the table and the corresponding description and value of that row.

I didn't find any way to access java arraylist in Javascript. Somewhere i read convert arraylist to javascript array but didn't find any concrete example.

Please do provide me some example of this scenario.
Some code snippets needed.
Thanks a lot.


Regards
Sachin
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8914
    
    8

This post is awful similar to your other post on the subject. You can't access the server-side array list from the client-side javascript. You'll have to print the array list values out and manipulate them with JavaScript, which seems pretty much what you are doing in your other post.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
GeeCON Prague 2014
 
subject: Javascript accessing Arraylist of the form