aspose file tools*
The moose likes Struts and the fly likes dynamic value to be submitted to form beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dynamic value to be submitted to form beans" Watch "dynamic value to be submitted to form beans" New topic
Author

dynamic value to be submitted to form beans

Kanika Sud
Greenhorn

Joined: May 09, 2011
Posts: 21
Hi,

This is my favourite forum. I just have a silly problem that's occuring on all of my pages.

If I have a drop down that's dynamically populated from the database through ajax, how do I get the selected value in the associated form bean. The bean takes the value (i tested it in the action class) of the list that is hard coded and not that is dynamically populated.

Here's the jsp:



Here's the script:





When I click the (<html:submit>) button I want the district(dynamic) to be access in the action class, but gives null.
This my first project with J2EE, Struts . Please help.
Kanika Sud
Greenhorn

Joined: May 09, 2011
Posts: 21
Sorry folks, this was a silly mistake in the script. The name attribute had not rendered itself properly because of the script.

Error's here:
var drop = '<select name="' + dynaDiv + ' id="' + dynaDiv + '">' + firstOpt + s + '</select>';



Sorry for posting such a silly one there.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic value to be submitted to form beans
 
Similar Threads
how to get both value and text of selected item in action class
doubt regarding <html:select>
Need help selected text fields visible for particular option from drop down list in JSP(struts)
enable/disable drop down
retrieve value of a field