ICEfaces
  1. ICEfaces
  2. ICE-7634

ace:dialog: ace:ajax event 'close' : Values not being updated, even with render="@all" & execute="@all"

    Details

    • Assignee Priority:
      P1

      Description

      I have a dialog with an ace:ajax tag embedded inside of it. There event type is 'close' and there is a listener call:
      <ace:ajax event="close" listener="${ajaxTestBean.closeEventListener}" />
      The default execute and render modes are being used which are "@all" for both.

      The form also contains three values bound to a bean:
      1. There is "message". This value is updated via the closeEventListener. (This is being updated on the page successfully)
      2. There is "valueA". This value increments itself in its setter. (This value is not being incremented or updated on the page)
      3. There is "valueB". This value also increments itself in its setter. (This value is not being incremented or updated on the page)

      When closing the dialog I would expect all values in the form to be updated (including valueA / valueB). However, this is not the case.

      To reproduce:
      1. Build / deploy test application.
      2. Navigate to 'Dialog Ajax ' test page.
      3. Follow the instructions on the page for the 'close Event Test'.
      Notice that the actual result is not what is expected (valueA & valueB are not updated).
      1. AjaxTestBean.java
        4 kB
        yip.ng
      2. dialogAjax.xhtml
        0.9 kB
        yip.ng
      1. screenshot-1.png
        108 kB
      2. screenshot-2.png
        100 kB
      3. screenshot-3.png
        88 kB
      4. screenshot-4.png
        83 kB

        Activity

        Hide
        yip.ng added a comment -

        Problem has nothing to do with ajax close event. The event gets through successfully.

        The problem is with the input text field on the page. Somehow, when you submit by ice.ace.ab(), the input text field setter doesn't get called on the server side, as if there was no execute for the input text field, even though the submit params are exactly the same as submitting via a command button: execute = all, render = all, input text field value = entered value. See screenshot-1.png.

        Tried out a lot of scenarios and traced a lot of code. Still no idea why.

        Show
        yip.ng added a comment - Problem has nothing to do with ajax close event. The event gets through successfully. The problem is with the input text field on the page. Somehow, when you submit by ice.ace.ab(), the input text field setter doesn't get called on the server side, as if there was no execute for the input text field, even though the submit params are exactly the same as submitting via a command button: execute = all, render = all, input text field value = entered value. See screenshot-1.png. Tried out a lot of scenarios and traced a lot of code. Still no idea why.
        Hide
        yip.ng added a comment - - edited

        Submit prarams seem to be received by server OK. See screenshot-2.png. So problem is not with the submit process?

        Show
        yip.ng added a comment - - edited Submit prarams seem to be received by server OK. See screenshot-2.png. So problem is not with the submit process?
        Hide
        yip.ng added a comment - - edited

        input text component executed properly if using ice.s() instead of ice.ace.ab() for submit. See screenshot-3.png. (But then the ajax close event won't work anymore.)

        Show
        yip.ng added a comment - - edited input text component executed properly if using ice.s() instead of ice.ace.ab() for submit. See screenshot-3.png. (But then the ajax close event won't work anymore.)
        Hide
        yip.ng added a comment - - edited

        See screenshot-4.png for submit params by a command button for comparison with submit params by ice.ace.ab() in screenshot-2.png.

        To use the minimalized test case, replace dialogAjax.xhtml and AjaxTestBean.java with attached versions.

        Show
        yip.ng added a comment - - edited See screenshot-4.png for submit params by a command button for comparison with submit params by ice.ace.ab() in screenshot-2.png. To use the minimalized test case, replace dialogAjax.xhtml and AjaxTestBean.java with attached versions.
        Hide
        Mircea Toma added a comment - - edited

        The issue is caused by the org.icefaces.ace.component.dialog.Dialog component itself. In its queueEvent(...) method FacesContext.renderResponse() method is invoked which effectively shortcuts the JSF lifecycle, skipping validation and update model phase. Value bindings are modified during update model phase, since the phase is not executed the AjaxTestBean.setValueA(...) and AjaxTestBean.setValueB(...) methods are not invoked anymore and the values are not incremented as expected.

        Show
        Mircea Toma added a comment - - edited The issue is caused by the org.icefaces.ace.component.dialog.Dialog component itself. In its queueEvent(...) method FacesContext.renderResponse() method is invoked which effectively shortcuts the JSF lifecycle, skipping validation and update model phase. Value bindings are modified during update model phase, since the phase is not executed the AjaxTestBean.setValueA(...) and AjaxTestBean.setValueB(...) methods are not invoked anymore and the values are not incremented as expected.
        Hide
        yip.ng added a comment - - edited

        Here is culprit line with comment from original "Grimlock" code:

        context.renderResponse(); //just process the close event and skip to response

        Useless comment. No info. about why.

        Line removed. Tested.

        Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\dialog\Dialog.java
        Completed: At revision: 27180

        Show
        yip.ng added a comment - - edited Here is culprit line with comment from original "Grimlock" code: context.renderResponse(); //just process the close event and skip to response Useless comment. No info. about why. Line removed. Tested. Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\dialog\Dialog.java Completed: At revision: 27180
        Hide
        Carmen Cristurean added a comment -

        Verified fix with code revision # 27182 in IE8, FF6, Chrome15.

        Show
        Carmen Cristurean added a comment - Verified fix with code revision # 27182 in IE8, FF6, Chrome15.

          People

          • Assignee:
            yip.ng
            Reporter:
            Cruz Miraback
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: