Results 1 to 2 of 2

Thread: webflow 2.0.6 ManySelectionTrackingListDataModel class bug

  1. #1
    Join Date
    Dec 2008
    Posts
    7

    Default 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

    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:

    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?
    Attached Images Attached Images
    Last edited by alireza; Apr 20th, 2009 at 09:51 AM.

  2. #2
    Join Date
    Nov 2008
    Posts
    742

    Default

    Any relation to this known bug? It's corrected in 2.0.7, which was just released. Try out 2.0.7 and see if the problem still exists.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •