2 Attachment(s)
webflow 2.0.6 ManySelectionTrackingListDataModel class bug
hi
I want to report a bug that I found in webflow 2.0.6.
Suppose that you have scenario like this
http://forum.springsource.org/attach...1&d=1240276482
so you must use ManySelectionTrackingListDataModel for handling check Box click:
userAdd-flow.xml:
Code:
...
<evaluate expression="userForm.getRoleList(messageContext)" result="flowScope.roles" result-type="org.springframework.faces.model.ManySelectionTrackingListDataModel" />
...
userEdit.xhtml:
Code:
...
<h:selectBooleanCheckbox id="selector" value="#{roles.currentRowSelected}"/>
...
when you click confirm button all of selected check box will be cleared:
http://forum.springsource.org/attach...1&d=1240276482
because of implementation of setCurrentRowSelected in ManySelectionTrackingListDataModel :
Code:
public void setCurrentRowSelected(boolean rowSelected) {
if (!isRowAvailable()) {
return;
}
if (rowSelected && !selections.contains(getRowData())) {
selections.add(getRowData());
}
else {
selections.remove(getRowData());
}
}
I changed this method to this:
Code:
public void setCurrentRowSelected(boolean rowSelected) {
if (!isRowAvailable()) {
return;
}
if (rowSelected && !selections.contains(getRowData())) {
selections.add(getRowData());
}
else if (!rowSelected && selections.contains(getRowData())) {
selections.remove(getRowData());
}
}
and now it works very good.
so is there anyone who have better solution for this scenario?