This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts 1 - <html:select multiple problem  RSS feed

Tim Kernan
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an html page which presents two lists and lets the user move items from one to the other. One list is a set of avaliable options to choose from and the second is a list of options which the user want to store/save. This second list will be initially populated with previously selected and stored options and the user can make the desired changes to his options list. This option transfer between lists all works nicely.

When the user clicks the SUBMIT button, I use an ONCLICK="" function to mark the items in the second list as SELECTED. Again, this all works fine.

The problem is receiving the data in the ActionForm. I can not access the returning data.

It appears that when the form is submitted the name assigned to each selected value is the same name as the Collection from which the options in the second list were generated. This seems odd.

Here is the DAO segment, calling setter:

Here is the GETTER and SETTER methods in the ActionForm

The JSP showing the second list only:

The error message I get shows that the setAssignedExceptionTable() method is called, the very same one used in the DAO to place the Collection in the Bean in the first place. This does not seem right.:

What puzzles me is that it appears that the name assigned to the selected value fields is the same name as the Collection form which they originated. The property defined in the <html:select statement is the name used and MUST be the name of the Collection (I get an error if it is not).Yet the <html:coptionsCollection statement seems to do the iterating.. It seem that one can not set a field name other than that which is the name of the Collection.

What dont I get??

Thank You.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!