ICEfaces
  1. ICEfaces
  2. ICE-8927

JavascriptContext.addJavascriptCall() doesn't work after a forward navigation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-1.8.2.GA_P04, EE-1.8.2.GA_P05
    • Fix Version/s: EE-1.8.2.GA_P06
    • Component/s: Bridge, Framework
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P1
    • Salesforce Case Reference:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Use a redirect navigation instead of a forward

      Description

      After a forward navigation is done, if the page has commandButtons that execute a JavascriptContext.addJavascriptCall() view an action or actionListener method, the script added to this call is not executed.


        Activity

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case Reference 5007000000QYFd5AAH
        Hide
        Arran Mccullough added a comment -

        Attached test case that shows the issue.

        Steps:

        • Load http://localhost:XXXX/Case11884Example/
        • Click on the 'Page Three' button.
        • Page3.jspx is now shown.
        • Clicking on the buttons should display an alert JavaScript. In the server logs there should be logs showing that these methods are being called.
        Show
        Arran Mccullough added a comment - Attached test case that shows the issue. Steps: Load http://localhost:XXXX/Case11884Example/ Click on the 'Page Three' button. Page3.jspx is now shown. Clicking on the buttons should display an alert JavaScript. In the server logs there should be logs showing that these methods are being called.
        Arran Mccullough made changes -
        Attachment Case11884Example.war [ 15379 ]
        Attachment Case11884Example.zip [ 15380 ]
        Hide
        Arran Mccullough added a comment -

        I have a few observations. With the attached sample if you click on the 'Page Two' button, this will forward to Page2.jspx and also call a JavascriptContext.addJavascriptCall() which will show an alert. This is working as long as some navigation is done in the same action method.

        Show
        Arran Mccullough added a comment - I have a few observations. With the attached sample if you click on the 'Page Two' button, this will forward to Page2.jspx and also call a JavascriptContext.addJavascriptCall() which will show an alert. This is working as long as some navigation is done in the same action method.
        Arran Mccullough made changes -
        Workaround Description Use a redirect navigation instead of a forward
        Workaround Exists Yes [ 10007 ]
        Hide
        Arran Mccullough added a comment -

        Note: This does not seem to be an issue in ICEfaces 3 using the same JavascriptContext API.

        Show
        Arran Mccullough added a comment - Note: This does not seem to be an issue in ICEfaces 3 using the same JavascriptContext API.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33411 Wed Feb 13 16:00:15 MST 2013 mircea.toma ICE-8927 Modified regular expression used for finding script elements in the updated markup to used grouping for start tag, content and end tag. Replace matched script tags with the same tags but without their content.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/bridge/lib/element.js
        Ken Fyten made changes -
        Assignee Mircea Toma [ mircea.toma ]
        Fix Version/s EE-1.8.2.GA_P06 [ 10470 ]
        Assignee Priority P1 [ 10010 ]
        Hide
        Mircea Toma added a comment -

        The issue occurs when a previous update (page navigation in this case) replaces the body element. The scripts are stripped from the updating markup to be evaluated afterwards. During the second update (when the "Test Action Listener" button is clicked) the script elements that needs to be replaced does not exists thus causing a JS error (seen in the log window).

        The fix modifies the regular expression used for finding script elements in the updated markup to use grouping for start tag, content and end tag. Then making use of this REGEXP grouping, the matched script tags are replaced with the same tags but without their content, thus making sure the script elements are present in the DOM.

        Show
        Mircea Toma added a comment - The issue occurs when a previous update (page navigation in this case) replaces the body element. The scripts are stripped from the updating markup to be evaluated afterwards. During the second update (when the "Test Action Listener" button is clicked) the script elements that needs to be replaced does not exists thus causing a JS error (seen in the log window). The fix modifies the regular expression used for finding script elements in the updated markup to use grouping for start tag, content and end tag. Then making use of this REGEXP grouping, the matched script tags are replaced with the same tags but without their content, thus making sure the script elements are present in the DOM.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Cruz Miraback added a comment -

        Confirmed fixed using ICEfaces 1.8.2.GA_P06 build 1 in Firefox19, Chrome24, IE6/7/9.

        Show
        Cruz Miraback added a comment - Confirmed fixed using ICEfaces 1.8.2.GA_P06 build 1 in Firefox19, Chrome24, IE6/7/9.
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: