This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic value to be submitted to form beans

 
Kanika Sud
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic