Iīm using spring2 and Spring-form tags.
In a form tag I want to fill a options list with values from another object(AddUserForm object) than the command object for the form.(User object)
I have created a set of organization objects in my form bean so the user can choose an organization when creating a user.
My problem is that I donīt know how to access the addUserForm.organizations set from the jsp-page.Code:<bean id="addUserForm" class="AddUserForm"> <property name="commandName" value="user"/> <property name="commandClass" value="User"/> <property name="formView" value="userForm"/> <property name="successView" value="userRedirect"/> <property name="validator" ref="userValidator"/> <property name="person" ref="person"/> <property name="organizations"> <set> <bean class="Organization"> <property name="id" value="40"/> <property name="name" value="test org"/> </bean> </set> </property> </bean>
I have tried to do like this and both with and without the spring:bind tag
what must I do to get access to the addUserForm bean from the JSP page?Code:<tr> <td><fmt:message key="person.label.organizations"/> br/> <form:select path="organizationId"> <form:option value="-" label="Select organization"/> <spring:bind path="addUserForm.*"> <form:options items="${addUserForm.organizations}" itemValue="id" itemLabel="name" /> </spring:bind> </form:select></td> </tr>
The main object for the page is User and thatīs the object which get the selected value.
/henrik


Reply With Quote