Announcement Announcement Module
Collapse
No announcement yet.
Problem with ManySelectionTrackingListDataModel in SWF 2.0.6 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with ManySelectionTrackingListDataModel in SWF 2.0.6

    I've been eagerly awaiting the release of SWF 2.0.6 to receive the fix for SWF-1018.

    Now, that it's out, I've upgraded. However, I'm still not getting the selection tracking I had hoped for.

    I have a Richfaces dataTable, paginated with a dataScroller. The first column in the dataTable contains checkboxes for selection of the rows.

    I mark checkboxes on page 1, go to page 2, and then return to page 1. The checkboxes on page 1 are in an unpredictable state with boxes randomly checked (in no obvious relation to the selections I had made).

    I'm a relative newbie to SWF and JSF. I don't know enough to know for sure if this is an issue with Richfaces, SWF, or the integration between the two. Help!

    My relevant code is listed below. If I've left out any useful details, let me know.

    Transition element from my flow definition:
    Code:
    <transition on="search">
        <evaluate expression="searchService.search()"
                      result="viewScope.results"
                      result-type="org.springframework.faces.model.ManySelectionTrackingListDataModel" />
        <render fragments="listFragment" />
    </transition>
    Table contained in "listFragment":
    Code:
    <rich:datascroller id="listScroller" for="resultsList" />
    <rich:dataTable id="resultsList" value="#{results}" var="result">
    ...
        <rich:column>
            <h:selectBooleanCheckbox value="#{results.currentRowSelected}" />
        </rich:column>
    ...
    </rich:dataTable>

  • #2
    Yes, there was definitely a bug in the implementation of setCurrentRowSelected that keeps this from working correctly. We weren't testing with this sort of eagerly populated DataModel and so it wasn't caught until now.

    SWF-1066 has been created and fixed. Please try out tonight's nightly build to verify that it solves your issue.

    Comment


    • #3
      Wow, thanks for the quick response and fix!
      I'll try out the Nightly tomorrow and post my findings here.

      Comment


      • #4
        Tested with 2.0.7.CI-64. It works!

        Thank you

        Comment


        • #5
          Well, the original problem that I posted has been fixed.

          However, I'm seeing 2 other problems now.
          1) When I click on any part of my row (not just the checkbox), the row gets selected. The checkbox isn't immediately rerendered, but moving to another page of the table and coming back reveals the checked checkbox.
          2) Once a row is selected, I can never seem to unselect it. Clicking on the checkbox or any part of the row always leaves the checkbox checked.


          #1 is not a terrible problem. I can live with that, if necessary. I've forced the checkbox to rerender, so the user can at least see that the row is selected:
          Code:
          <rich:datascroller id="listScroller" for="resultsList" />
          <rich:dataTable id="resultsList" value="#{results}" var="result">
          ...
              <a4j:support event="onRowClick" reRender="checkbox" />
              <rich:column>
                  <h:selectBooleanCheckbox id="checkbox" value="#{results.currentRowSelected}" />
              </rich:column>
          ...
          </rich:dataTable>
          #2 is the big problem. Obviously, users will want to unselect items. Am I doing something wrong? Any ideas?

          Comment


          • #6
            > #2 is the big problem. Obviously, users will want to unselect items. Am I doing something wrong? Any ideas?
            Reply With Quote

            Did you find a resolution for this?

            It appears the changes for
            https://jira.springframework.org/browse/SWF-1018
            a) allow you to explicitly manage selection (eg via a row-selecting ui-element), but
            b) didn't do anything to prevent the SelectionTrackingActionListener from auto-selecting any row that it observes an action on so if you attach an ajax event handler to a checkbox being used for row-selection it's impossible to unselect the row.

            Comment

            Working...
            X