rich:orderinglist doesn't take multi selection
gunnarstahl Sep 9, 2010 7:11 AMHello Community,
I have some trouble with how the ordering list works. The following is an excerpt of my ordering list:
<rich:orderingList id="AngebotsListe" listWidth="825px"
listHeight="755px" controlsType="button"
value="#{listModelBean.visibleAngebotElements}"
var="angebotsElement" converter="ProspektElementConverter"
selection="#{listModelBean.selectedAngebotElements}">
[Multiple column definitions]
<a4j:support event="ondblclick" ignoreDupResponses="true"
requestDelay="500"
actionListener="#{listControllerBean.editAngebotsPanelRequested}" reRender="pnlEditAngebotsElementContainer"/>
<a4j:support event="onclick" ignoreDupResponses="true"
requestDelay="500" actionListener="#{listControllerBean.takeSelection}"/>
Whenever I click on one row of the list the listModelBean.selectedAngebotElements is updated with the selected row. The listControllerBean.takeSelection is called and executes the following code:
public void takeSelection(ActionEvent event) {
logger.debug("In takeSelection...");
logger.debug("Trying to find component with offering elements...");
UIComponent component = event.getComponent().getParent();
logger.debug("Found: " + (component == null ? "<null>" : (component.getClass().getName() + " - " + component.getId())));
if(component != null) {
logger.debug("Component that fired the event: " + component.getClass().getSimpleName() + " - " + component.getId());
UIOrderingList orderingList = (UIOrderingList)component;
Set<AngebotsElementTO> selection = ListModelBean.getInstance().getSelectedAngebotElements();
logger.debug("Selection. "+ (selection == null ? "<null>" : selection.size()) + " - Setting selection in listmodelbean");
}
logger.debug("Leaving takeSelection");
}
The log output shows that one row has been selected.
The same happens when I select multiple rows via <ctrl>+click. But instead of providing me with the list of rows that are selected only the last selected row is shown. Currently I have no way of knowing how many rows have been selected. Which annoys me...
How can I find out which rows of the ordering list have been selected?
Yt,
Gunnar