ICEfaces
  1. ICEfaces
  2. ICE-5652

UpdateElements.coalesceWithPrevious overwrites JavaScript calls

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2
    • Fix Version/s: 1.8.3, 1.8.2-EE-GA_P02, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Linux
      Java 1.6.0_18

      Description

      Our web application receives async events from our external application server that directs the web application to display something new. For example, an event is sent to the web server environment to display a certain object in a page, or display a tab within a page, or focus on a specific field on a page. To implement this, we use Server push to update the page in the browser, and often we use javascript calls (via the JavascriptContext.addJavascriptCall method) to execute this. Typically, we use the renderLater() method on the PersistentFacesContext to initiate the server push.

      We can get multiple async events at once from our server. We've noticed cases where multiple events were being applied to the PersistentFacesState before it had a chance to send the updates to the browser. In these cases, the UpdateElements were combining the changes (as expected).

      What we noticed was if two or more commands were coalesced together, and both commands had different Javascript commands, only the last one was sent to the browser. The coalesce command overwrote any existing Javascript command with the last one in. This is causing us problems, as many of the subsequent events rely on the previous events being sent.
      1. javascript_coalesce.patch
        1 kB
        Ed Hillmann
      2. updatedPatch.txt
        3 kB
        Ed Hillmann

        Activity

        Hide
        Ken Fyten added a comment -

        Krashan, we are unable to reproduce any issues with draggable not always working. Please ensure your browser cache has been cleared and that you have the latest JS, etc.

        Show
        Ken Fyten added a comment - Krashan, we are unable to reproduce any issues with draggable not always working. Please ensure your browser cache has been cleared and that you have the latest JS, etc.
        Hide
        Ken Fyten added a comment -

        The popup panel is not working correctly on icefaces2/trunk compat component showcase as of svn rev# 23167.

        • Modal popup is not modal.
        • Draggable popup is not draggable.
        • Autocentre popup does not autocentre.

        Note that icefaces/trunk popup is working correctly.

        Show
        Ken Fyten added a comment - The popup panel is not working correctly on icefaces2/trunk compat component showcase as of svn rev# 23167. Modal popup is not modal. Draggable popup is not draggable. Autocentre popup does not autocentre. Note that icefaces/trunk popup is working correctly.
        Hide
        Mircea Toma added a comment -

        Changed PanelPopupRenderer in icefaces2.0/compat to render the JS code as unescaped text. This way browsers interpret the code correctly when updating the elements that include scripts.

        Show
        Mircea Toma added a comment - Changed PanelPopupRenderer in icefaces2.0/compat to render the JS code as unescaped text. This way browsers interpret the code correctly when updating the elements that include scripts.
        Hide
        Ed Hillmann added a comment -

        Hi. I've applied 1.8.2 EE Patch 2 to our application, and I get the original error again: attempts to assign focus to a field using Server Push sporadically fail. When I reapply the changes to UpdateCommand as provided in the Patch, the behaviour works consistently (the focus is assigned to the correct field). It still appears that if commands are coalesced, earlier javascript commands are lost if the new command being coalesced contains its own Javascript value.

        I have not tested this with 2.0.

        Show
        Ed Hillmann added a comment - Hi. I've applied 1.8.2 EE Patch 2 to our application, and I get the original error again: attempts to assign focus to a field using Server Push sporadically fail. When I reapply the changes to UpdateCommand as provided in the Patch, the behaviour works consistently (the focus is assigned to the correct field). It still appears that if commands are coalesced, earlier javascript commands are lost if the new command being coalesced contains its own Javascript value. I have not tested this with 2.0.
        Hide
        Mircea Toma added a comment -

        I'll have a look.

        Show
        Mircea Toma added a comment - I'll have a look.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Ed Hillmann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: