Hi,
I have a question for you guys.
I am creating a multiple selectable list box using struts.which is fine below is fine.
The problem comes in that the page is loaded for a specific user and I have to search the db for any roles for this user and if the user already have roles then I need to make this list box pre-select those roles in the list box.
I can not seem to get my hands on any syntax that will help me do this.
I was thinking along these lines
<bean:define id="roles" property="rolesList" name="login"/>
<html:select property="roles" style="width:120px;height:130px;" multiple="true">
<html:options collection="roles" property="roleId" labelProperty="name" />
</html:select>
the line of code above thats in bold, I was thinking, if I could pass that particular roleId to the form and then if this roleId has a role then return a string that will make this list option selected kinda like this
<html:options collection="rolesList" property="roleId" labelProperty="name" <bean:write name"formName" property="getSelected(roleId)"/> />
is there a way to get this done using struts????
I appriciate the guidance