ICEfaces
  1. ICEfaces
  2. ICE-7239

ace:DataTable Page Attribute Value Incorrectly State Saved

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta
    • Fix Version/s: 2.1-Beta2, 3.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      IF2.1
    • Assignee Priority:
      P2
    • Workaround Exists:
      Yes
    • Workaround Description:
      Bind page.

      Description

      The ace:dataTable should be able to hold an internal indicator of the current page, this is done via the page attribute, which may be optionally bound to. However when the page attribute is unbound, pagination occurs correctly, but subsequent requests don't have updated value. The value returned by getPage() stays at 1, the value supplied to setPage() during the first calculation of the 'first' value.

        Activity

        Nils Lundquist created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Salesforce Case []
        Component/s ACE-Components [ 10050 ]
        Fix Version/s 2.1-Beta [ 10291 ]
        Assignee Priority P2
        Affects Version/s 2.1-Beta [ 10291 ]
        Security Private [ 10001 ]
        Assignee Nils Lundquist [ nils.lundquist ]
        Hide
        Nils Lundquist added a comment -

        This issue should still be present. When this issue was investigated there was a separate pagination issue presenting in the POC.
        I will test later today to confirm.

        Show
        Nils Lundquist added a comment - This issue should still be present. When this issue was investigated there was a separate pagination issue presenting in the POC. I will test later today to confirm.
        Ken Fyten made changes -
        Fix Version/s 2.1 [ 10241 ]
        Fix Version/s 2.1-Beta [ 10291 ]
        Hide
        Nils Lundquist added a comment - - edited

        An issue very much like this one appears to be effecting the decoding of components in pages greater than 1.

        This is because visitTree is receiving the incorrect value from getFirst(). visitTree relies on getFirst() to tell it where to begin per-row visiting, and getRows() to determine row far to iterate.

        At the end of a request that causes pagination, getFirst() returns the correct value, at the beginning of following requests, getFirst() returns 0, and visitTree incorrectly performs per-row visits for the first page of components.

        The easiest way to reproduce this error is by adding pagination to an example of row editing, like the Row State example on the comp-suite.

        Show
        Nils Lundquist added a comment - - edited An issue very much like this one appears to be effecting the decoding of components in pages greater than 1. This is because visitTree is receiving the incorrect value from getFirst(). visitTree relies on getFirst() to tell it where to begin per-row visiting, and getRows() to determine row far to iterate. At the end of a request that causes pagination, getFirst() returns the correct value, at the beginning of following requests, getFirst() returns 0, and visitTree incorrectly performs per-row visits for the first page of components. The easiest way to reproduce this error is by adding pagination to an example of row editing, like the Row State example on the comp-suite.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #25908 Wed Oct 12 11:07:18 MDT 2011 deryk.sinotte ICE-7239: ensure state is saved in all Ajax request scenarios
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java
        Hide
        Deryk Sinotte added a comment -

        Debugging the DOMPartialViewContext.processPartial method:

        if (phaseId == PhaseId.RENDER_RESPONSE) {
        try {
        PartialResponseWriter partialWriter = getPartialResponseWriter();

        ...
        if ((null == oldDOM) && isRenderAll())

        { ... renderState(); renderExtensions(); } else if (null != diffs) { ... renderState(); renderExtensions(); }

        partialWriter.endDocument();

        When use the ACE paginator, neither the "if" or "else if" section is meeting the condition so the renderState() and renderExtensions() are never called. It looks like it's a result of the custom update processing that the ACE components do to calculate their own updates. The renderState() section is what calls getViewState and triggers the view state to be saved. By factoring the renderState() and renderExtension() calls so that they are always invoked, the problem goes away.

        if (phaseId == PhaseId.RENDER_RESPONSE) {
        try {
        PartialResponseWriter partialWriter = getPartialResponseWriter();

        ...
        if ((null == oldDOM) && isRenderAll())

        { ... } else if (null != diffs) { ... }

        renderState();
        renderExtensions();
        partialWriter.endDocument();

        Show
        Deryk Sinotte added a comment - Debugging the DOMPartialViewContext.processPartial method: if (phaseId == PhaseId.RENDER_RESPONSE) { try { PartialResponseWriter partialWriter = getPartialResponseWriter(); ... if ((null == oldDOM) && isRenderAll()) { ... renderState(); renderExtensions(); } else if (null != diffs) { ... renderState(); renderExtensions(); } partialWriter.endDocument(); When use the ACE paginator, neither the "if" or "else if" section is meeting the condition so the renderState() and renderExtensions() are never called. It looks like it's a result of the custom update processing that the ACE components do to calculate their own updates. The renderState() section is what calls getViewState and triggers the view state to be saved. By factoring the renderState() and renderExtension() calls so that they are always invoked, the problem goes away. if (phaseId == PhaseId.RENDER_RESPONSE) { try { PartialResponseWriter partialWriter = getPartialResponseWriter(); ... if ((null == oldDOM) && isRenderAll()) { ... } else if (null != diffs) { ... } renderState(); renderExtensions(); partialWriter.endDocument();
        Hide
        Deryk Sinotte added a comment -

        Checked in change (r25908) to DOMPartialViewContext.

        Show
        Deryk Sinotte added a comment - Checked in change (r25908) to DOMPartialViewContext.
        Deryk Sinotte made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.1-Beta2 [ 10294 ]
        Ken Fyten made changes -
        Security Private [ 10001 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Nils Lundquist
            Reporter:
            Nils Lundquist
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: