File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!