ICEfaces
  1. ICEfaces
  2. ICE-5691

Navigation only works on every second button click.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Beta1, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 2 JSF 2
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      You can either

      - remove the <?xml line from the document
      - provide a specific id attribute for the form to prevent it from oscillating (e.g. <form id="theForm")
      - specify a specific sub tree to render rather than rendering (<f:ajax render="theForm"/>)
      Show
      You can either - remove the <?xml line from the document - provide a specific id attribute for the form to prevent it from oscillating (e.g. <form id="theForm") - specify a specific sub tree to render rather than rendering (<f:ajax render="theForm"/>)

      Description

      Under certain conditions, the ViewState may not get written to the page/form which causes a problem when navigating. The typical result is that every second click of a button that triggers navigation doesn't appear to work. The problematic behaviour is actually seen in Mojarra 2.0.2 without ICEfaces. The conditions required are:

      The page starts with the XML preamble like: <?xml version="1.0" encoding="UTF-8"?>
      The form does not have a specific id set on it: <h:form prependId="false">
      The button is Ajax-enabled with render all:

      <h:commandButton id="navButton" value="Go to Page 2" action="page02">
          <f:ajax render="@all"/>
      </h:commandButton>

      So given a couple of simple pages like this that navigate back and forth to each other:

      <?xml version="1.0"?>
      <!DOCTYPE html
              PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core">
      <h:head>
          <title>Ajax Navigation</title>
      </h:head>

      <h:body>
          
           <h:form prependId="false">
              <p>
                  <h:commandButton id="navButton" value="Go to Page 2" action="page02" >
                      <f:ajax render="@all"/>
                  </h:commandButton>
              </p>
          </h:form>

      </h:body>
      </html>

      will result in every second click failing.

        Activity

        Hide
        Deryk Sinotte added a comment -

        The problem seems to be that under the above conditions, the id of the form oscillates between two different values and the client code cannot properly write out the ViewState update into the form because it can't find it. If you note the workarounds, specifying a specific id for the form helps prevent this. So does removing the <?xml line (but I can't understand why this impacts the behaviour at all yet). You can also choose to render a specific subtree rather than @all and that should work as well.

        Since this problem occurs without ICEfaces in Mojarra 2.0.2, we aren't going to investigate fixing it any further. We may want to consider opening a bug with the Mojarra project if the problem persists in the current Mojarra trunk.

        Show
        Deryk Sinotte added a comment - The problem seems to be that under the above conditions, the id of the form oscillates between two different values and the client code cannot properly write out the ViewState update into the form because it can't find it. If you note the workarounds, specifying a specific id for the form helps prevent this. So does removing the <?xml line (but I can't understand why this impacts the behaviour at all yet). You can also choose to render a specific subtree rather than @all and that should work as well. Since this problem occurs without ICEfaces in Mojarra 2.0.2, we aren't going to investigate fixing it any further. We may want to consider opening a bug with the Mojarra project if the problem persists in the current Mojarra trunk.
        Hide
        Ken Fyten added a comment -

        Let's submit a Mojarra bug w/ test case asap.

        Show
        Ken Fyten added a comment - Let's submit a Mojarra bug w/ test case asap.
        Hide
        Deryk Sinotte added a comment -

        Re-assigning to Mircea as a "todo" item - please submit a bug to the Mojarra tracking system regarding this behaviour.

        Show
        Deryk Sinotte added a comment - Re-assigning to Mircea as a "todo" item - please submit a bug to the Mojarra tracking system regarding this behaviour.
        Hide
        Mircea Toma added a comment -

        Created issue in Mojarra's bug tracking system: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1715

        Show
        Mircea Toma added a comment - Created issue in Mojarra's bug tracking system: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1715
        Hide
        Mircea Toma added a comment -

        Trying to fix this issue on the ICEfaces side. Recreating the javax.faces.ViewState input elements on the client side seems to be a much easier fix.

        Show
        Mircea Toma added a comment - Trying to fix this issue on the ICEfaces side. Recreating the javax.faces.ViewState input elements on the client side seems to be a much easier fix.
        Hide
        Mircea Toma added a comment -

        The solution applied adds the hidden input element holding the view state key into the forms that miss it after they are updated.

        Show
        Mircea Toma added a comment - The solution applied adds the hidden input element holding the view state key into the forms that miss it after they are updated.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: