Using RichFaces 3.1.4 + Seam 2.0.1 its seems that the selected of orderingList is not working . When working in the following code and selecting items list is always empty
the Xhtml
<a:form id="new_item_list"> <rich:orderingList value="#{addData.newPersonalList}" var="item" listWidth="200px" controlsType="button" selection="#{addData.newPersonalListChose}" showButtonLabels="false"> <f:facet name="caption"> <h:outputText value="Chosen Data"/> </f:facet> <rich:column> <f:facet name="header"> <h:outputText value="Description" /> </f:facet> <h:outputText value="#{item.itemHeader}" /> </rich:column> </rich:orderingList> </a:form> <!-- list of entered data --> <a:form> <a:commandButton value="Remove" action="#{addData.removeItemNew}" reRender=" new_item_list" </a:form>
private ArrayList<DataToFetch> newPersonalListChose = new ArrayList<DataToFetch>(); // list of chosen from the many list private List<DataToFetch> newPersonalList = new ArrayList<DataToFetch>(); // list of items added
public void removeItemNew() { for(DataToFetch item:newPersonalListChose) { // check if the item has parts for(DataToFetch partItem:newPersonalListParts) { if (partItem.getItemHeader().equals(item.getItemHeader())) newPersonalListParts.remove(partItem); } newPersonalList.remove(item); } }
What does the rest of AddData look like?
I assume this is a SFSB then? with the getters and setters on the interface?