This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Struts and the fly likes dropdowns within iterator in struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dropdowns within iterator in struts2" Watch "dropdowns within iterator in struts2" New topic

dropdowns within iterator in struts2

Swathi Ram

Joined: Sep 18, 2007
Posts: 27
I have an iterator that displays 2 dropdowns that gets diaplayed according to the iterator value.
The second dropdown is driven by the first. So based on the value selected in the first, the second should be displayed.

<s:select name="jobList[%{#rowstatus.index}].classification" list="classifications" onchange="JavaScript:submitFormClass(%{#rowstatus.index})" />

<s:select name="jobList[%{#rowstatus.index}].speciality" list="jobList[%{#rowstatus.index}].specialities" />

jobList.specialities is a Map.

But this gives me an error saying :
Servlet.service() for servlet jsp threw exception
tag 'select', field 'list', name 'jobList[0].speciality': The requested list key 'jobList[%{#rowstatus.index}].specialities' could not be resolved as a collection/array/map/enumeration/iterator type.

It is printing it in the action class but not in the jsp.
Can anyone help please......

Swathi Ram

Joined: Sep 18, 2007
Posts: 27
Has anyone got any input on this. Is is OK to give a Map() within an object and having an array of objects and iterating through them??
I agree. Here's the link:
subject: dropdowns within iterator in struts2
jQuery in Action, 3rd edition