ICEfaces
  1. ICEfaces
  2. ICE-10096

ace:dataTable - Issue with lazy loading and request scope

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.3.0.GA_P01, EE-3.3.0.GA_P02
    • Fix Version/s: 4.0, EE-3.3.0.GA_P03
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P2
    • Support Case References:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Use a View or Window Scope for the managed bean instead of the Request scope.

      Description

      An ace:dataTable uses lazy loading. The managed bean for the for the list is a request scoped bean. This is working well when displaying the data in the table.

      The issue is seen when trying to send a check box selection to another bean. This other bean is a session scoped bean. If the selectBooleanCheckbox uses an f:ajax tag or the icecore:singleSubmit tag is used, the selection is lost (clicking a checkbox will immediately uncheck it). The response returned is clearing out the checkbox.

      If lazy loading is set to false and the full set of data is used, this is not an issue using the same request/session scoped bean combination.

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case source code and war file. Note, to run the war file the icefaces ace and icefaces core jar files need to be added back in.

        Steps:

        • Load welcomeICEfaces.jsf
        • Page is loaded with data for the first 10 records. In the server logs there is a debug statement for the request scoped bean constructor.
        • Clicking on one of the checkboxes will cause the selected to me immediately removed. If you comment out the <f:ajax> tag for this, then the selection will stay.
        • If the selection is kept, clicking on the Submit button will show another log "selectedRow: 0". This indicates that the checkbox selections are not being kept.
        • To test the non-lazy loading behavior, set lazy="false" and value="# {testBean.allData}

          " on the ace:dataTable component in welcomeICEfaces.xhtml

        Show
        Arran Mccullough added a comment - Attached test case source code and war file. Note, to run the war file the icefaces ace and icefaces core jar files need to be added back in. Steps: Load welcomeICEfaces.jsf Page is loaded with data for the first 10 records. In the server logs there is a debug statement for the request scoped bean constructor. Clicking on one of the checkboxes will cause the selected to me immediately removed. If you comment out the <f:ajax> tag for this, then the selection will stay. If the selection is kept, clicking on the Submit button will show another log "selectedRow: 0". This indicates that the checkbox selections are not being kept. To test the non-lazy loading behavior, set lazy="false" and value="# {testBean.allData} " on the ace:dataTable component in welcomeICEfaces.xhtml
        Hide
        Mircea Toma added a comment - - edited

        Modified DataTable.visitRowsAndExpandedRows method to load the lazy data model before iterating over the row components during apply request values and update model values JSF phases.
        Before the LazyDataModel instance would not load the actual data thus cancelling the iteration over the rows (isRowAvailable would return false).

        Show
        Mircea Toma added a comment - - edited Modified DataTable.visitRowsAndExpandedRows method to load the lazy data model before iterating over the row components during apply request values and update model values JSF phases. Before the LazyDataModel instance would not load the actual data thus cancelling the iteration over the rows ( isRowAvailable would return false).
        Hide
        Rahul Chaudhary added a comment -

        Hi. I do not understand what has been changed to correct this issue. I have studied the attached Example 2 code. I see that you have added "allData" arraylist in the TestBean.java but you have not used that variable anywhere. How does this resolve the issue ?

        Also in the last comment you mentioned that you have modified DataTable.visitRowsAndExpandedRows, but I do not see where you have done that in the code. Am I missing some files ?

        Can you elaborate on this solution a bit more please so that I can figure out what you are suggesting me to do.

        Thank You.

        Show
        Rahul Chaudhary added a comment - Hi. I do not understand what has been changed to correct this issue. I have studied the attached Example 2 code. I see that you have added "allData" arraylist in the TestBean.java but you have not used that variable anywhere. How does this resolve the issue ? Also in the last comment you mentioned that you have modified DataTable.visitRowsAndExpandedRows, but I do not see where you have done that in the code. Am I missing some files ? Can you elaborate on this solution a bit more please so that I can figure out what you are suggesting me to do. Thank You.
        Hide
        Mircea Toma added a comment -

        The allData arraylist is used in other tests I believe. If you look into the Subversion tab of this issue you get the diff, just one line of code was added.

        Show
        Mircea Toma added a comment - The allData arraylist is used in other tests I believe. If you look into the Subversion tab of this issue you get the diff, just one line of code was added.
        Hide
        Rahul Chaudhary added a comment -

        Hi, Its good to know that this issue has been resolved on your end and will be available to pubic on the next release. However, I would like to know when that release is coming. The reason is that our own release is coming on sometime at the end of this month, and we have to address this memory issue (kind of promised to customers), so is there any way you can get the release to us before our release so that we can go ahead and finish the code for this ?

        Thank You.

        Show
        Rahul Chaudhary added a comment - Hi, Its good to know that this issue has been resolved on your end and will be available to pubic on the next release. However, I would like to know when that release is coming. The reason is that our own release is coming on sometime at the end of this month, and we have to address this memory issue (kind of promised to customers), so is there any way you can get the release to us before our release so that we can go ahead and finish the code for this ? Thank You.
        Hide
        Rahul Chaudhary added a comment -

        Hi,

        Does the new release 4.0 RC1 contains the solution for this issue ?

        Thank You.

        Show
        Rahul Chaudhary added a comment - Hi, Does the new release 4.0 RC1 contains the solution for this issue ? Thank You.
        Hide
        Mircea Toma added a comment -

        Yes, 4.0RC1 contains the fix for this issue.

        Show
        Mircea Toma added a comment - Yes, 4.0RC1 contains the fix for this issue.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: