Problem Pre-populating selected part of AddRemove List
I'm building a "CRUD"-type app. My "create" screen works fine, and includes an AddRemove List component.
My "update" screen needs to pre-populate the ARL, both the items to select from and the already selected items previously saved.
I've tried this 2 ways:
1) Pre-populating the list pointed to by the "selected" attribute in my JSP ARL component.
2) Binding the ARL, and in the init() method calling setSelected();
They both work in the sense that my list is displayed, and both lists are pre-populated exactly like I want. The problem is I can't Add or Remove anything!
Here's my JSP code:
<ui:addRemove availableItemsLabel="(Available:)"
id="SessionAddRemoveList"
items="#{sessionsBean.sessionSelectList}"
binding="#{ProgramEdit.sessionAddRemoveList}"
required="true"
rows="10"
selected="#{programBean.newSelectedSessionsList}"
selectedItemsLabel="(Selected:)"
vertical="true">
<f:facet name="addButton">
<ui:button id="SessionAddRemoveList_addButton" onClick="AddRemove_ProgramAddForm_SessionAddRemoveList.add()" style="width: 100px" text="Add"/>
</f:facet>
<f:facet name="removeButton">
<ui:button id="SessionAddRemoveList_removeButton" onClick="AddRemove_ProgramAddForm_SessionAddRemoveList.remove()" style="width: 100px" text="Remove"/>
</f:facet>
</ui:addRemove>
And here's the type behind the items attribute (not using the msol):
ArrayList<Option> sessionSelectList =new ArrayList <Option>();
[Each Option is an int, String pair for the value, title]
And here's the type behind the "selected" attriute
int[] selectedSessionsList;
[An int[], corresponding the the int values in my Option array.]
Why can't I edit the items in the ARL when I pre-populate the "selected" list? There has to be a way to do this....
Help!
Thanks,
-Craig

