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

        Cruz Miraback created issue -
        Cruz Miraback made changes -
        Field Original Value New Value
        Environment ICEfaces3 Trunk Revision# 27084
        Server: Tomcat6
        Browsers: Firefox/Chrome/IE
        Test app located at: http://server.ice:8888/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/dialog
        ICEfaces3 Trunk Revision# 27084
        Server: Tomcat6
        Browsers: Firefox/Chrome/IE
        Test app located at: http://server.ice:8888/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/dialog
        Salesforce Case []
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P2
        Assignee yip.ng [ yip.ng ]
        yip.ng made changes -
        Attachment screenshot-1.png [ 13959 ]
        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.
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P2 P1
        yip.ng made changes -
        Attachment screenshot-2.png [ 13962 ]
        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?
        yip.ng made changes -
        Attachment screenshot-3.png [ 13963 ]
        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.)
        yip.ng made changes -
        Attachment AjaxTestBean.java [ 13964 ]
        Attachment dialogAjax.xhtml [ 13965 ]
        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.
        yip.ng made changes -
        Attachment screenshot-4.png [ 13966 ]
        Ken Fyten made changes -
        Salesforce Case []
        Assignee yip.ng [ yip.ng ] Mircea Toma [ mircea.toma ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27180 Thu Jan 12 15:42:56 MST 2012 yip.ng ICE-7634: ace:dialog: ace:ajax event 'close' : Values not being updated, even with render="@all" & execute="@all".
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dialog/Dialog.java
        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.
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Mircea Toma [ mircea.toma ] yip.ng [ yip.ng ]
        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
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        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.
        Ken Fyten made changes -
        Security Private [ 10001 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: