• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Struts 1 - <html:select multiple problem

Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic