ICEfaces
  1. ICEfaces
  2. ICE-10833

ace:dialog issue with cleared cache browser and pasted URL.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 4.1
    • Fix Version/s: EE-4.1.0.GA
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces 4 trunk r46143. Tomcat 7, all browsers.

      Description

      An ace:dialog with an enclosed ace component will close unexpectedly after performing a submit with the enclosed ace component. This will only occur if the browser cache is clear and the demo is accessed via pasting the full page URL into the address bar. I was able to reproduce this issue with a variety of ace comps enclosed within ace:dialogs, did not test them all.
      Very specific steps to reproduce:
      (using ace:menu inside ace:dialog as an example)
      1.) Build and deploy the menu.war file from the QA test app:
      http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/menu.
      2.) Open a browser, clear the browser cache and refresh the page.
      3.) Paste this URL into the browser
      http://localhost:8080/menu/menuInDialog.jsf
      4.) When page loads press the "Show" button to display the ace:dialog.
      5.) Select a MenuItem
      6.) ace:dialog closes unexpectedly.
      This issue does not occur if you navigate to the demo via the start page or if you are not using a browser cleared cache.

       

        Activity

        Hide
        Arturo Zambrano added a comment - - edited

        This issue describes the exact same situation described in ICE-10510, ICE-10481, and at the end of ICE-10477 and ICE-10834.

        This situation is caused by the framework, not by the component. It only happens when you directly load a page on the browser (as opposed to navigating to it). This happens because two hidden input elements are always added (or removed) to the form, by JSF, at the very first request of a user session. These hidden input fields look like the ones below:

        <input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:4" value="3917806814953621022:5289803863285839978" autocomplete="off"></input>
        <input type="hidden" name="javax.faces.ClientWindow" id="j_id1:javax.faces.ClientWindow:4" value="27i641x389" autocomplete="off"></input>
        

        Because these fields are not initially there, the domdiff sends an update of the whole form to add them. This causes all the components inside the form to be re-initialized in their original state, which in the case of the dialog is closed. This also occurs especially because the ace:dialog tag in the xhtml has the property visible="false" hard-coded. If somehow this property was changed to visible when pressing the button, the dialog would stay open.

        All this situation is avoided if these hidden fields are rendered right from the start. This can be accomplished by creating a jsp document that redirects to the xhtml document that presents this situation. In this case you can create a file named menuInDialog.jsp, whose only contents are the following.

        <% response.sendRedirect("menuInDialog.jsf"); %>
        

        Then you would simply navigate to:
        http://localhost:8080/menu/menuInDialog.jsp
        ...instead of navigating to:
        http://localhost:8080/menu/menuInDialog.jsf

        This navigation techinque is the same used for the index pages of all test apps we have.

        Show
        Arturo Zambrano added a comment - - edited This issue describes the exact same situation described in ICE-10510, ICE-10481, and at the end of ICE-10477 and ICE-10834 . This situation is caused by the framework, not by the component. It only happens when you directly load a page on the browser (as opposed to navigating to it). This happens because two hidden input elements are always added (or removed) to the form, by JSF, at the very first request of a user session. These hidden input fields look like the ones below: <input type= "hidden" name= "javax.faces.ViewState" id= "j_id1:javax.faces.ViewState:4" value= "3917806814953621022:5289803863285839978" autocomplete= "off" ></input> <input type= "hidden" name= "javax.faces.ClientWindow" id= "j_id1:javax.faces.ClientWindow:4" value= "27i641x389" autocomplete= "off" ></input> Because these fields are not initially there, the domdiff sends an update of the whole form to add them. This causes all the components inside the form to be re-initialized in their original state, which in the case of the dialog is closed. This also occurs especially because the ace:dialog tag in the xhtml has the property visible="false" hard-coded. If somehow this property was changed to visible when pressing the button, the dialog would stay open. All this situation is avoided if these hidden fields are rendered right from the start. This can be accomplished by creating a jsp document that redirects to the xhtml document that presents this situation. In this case you can create a file named menuInDialog.jsp, whose only contents are the following. <% response.sendRedirect( "menuInDialog.jsf" ); %> Then you would simply navigate to: http://localhost:8080/menu/menuInDialog.jsp ...instead of navigating to: http://localhost:8080/menu/menuInDialog.jsf This navigation techinque is the same used for the index pages of all test apps we have.
        Hide
        Arturo Zambrano added a comment -

        Added an entry under Known Issues in the ace:dialog and ace:confirmationDialog wiki pages to document this scenario.

        Show
        Arturo Zambrano added a comment - Added an entry under Known Issues in the ace:dialog and ace:confirmationDialog wiki pages to document this scenario.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Liana Munroe
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: