MyFaces Core
  1. MyFaces Core
  2. MYFACES-3521

javax.faces.ViewState is not updated after ajaxResponse

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.6
    • Fix Version/s: 2.1.7
    • Component/s: JSR-314
    • Labels:
      None
    • Environment:
      all

      Description

      click 2x times on link

      <h:form>
      <script>
      var x= new String("a")
      </script>
      <script>
      (1==3)? 'd':'e';
      </script>
      <h:commandLink value="link">
      <f:ajax render="@form"/>
      </h:commandLink>
      </h:form>

      I'm not sure that is bug but works in jsf-ri.
      In real scenario problem occurs for example if AUTO_SCROLL in contex-param is set to true and rich:tooltip is used.

      Rendered HTML markup:

      <script>
      <!--
      new RichFaces.ui.Tooltip("j_id_v:j_id_3y",{"ajax":

      {"incId":"1"}

      ,"target":"j_id_v:j_id_3y","offset":[10,10] } )
      //-->
      </script>
      <script>
      <!--
      (!window.myfaces) ? window.myfaces = {} : null;(!myfaces.core) ? myfaces.core = {} : null;(!myfaces.core.config) ? myfaces.core.config = {} : null;myfaces.core.config.autoScroll = true;
      //-->
      </script>

      see
      https://issues.jboss.org/browse/RF-12130

        Activity

        Hide
        Werner Punz added a comment - - edited

        Hello the viewstate update should work, i am testing automatically for that before every release in one of my testcases, can you isolate your usecase into a single war and post it here so that I can have a deeper look at the webapp configuration and which version of richfaces, myfaces etc...
        My personal guess is something in richfaces breaks it or in the version of richfaces you use.

        Show
        Werner Punz added a comment - - edited Hello the viewstate update should work, i am testing automatically for that before every release in one of my testcases, can you isolate your usecase into a single war and post it here so that I can have a deeper look at the webapp configuration and which version of richfaces, myfaces etc... My personal guess is something in richfaces breaks it or in the version of richfaces you use.
        Hide
        wojtask added a comment - - edited

        i forgot to say.

        <script>
        var x= new String("a")
        </script>
        <script>
        (1==3)? 'd':'e';
        </script>

        As you can see after new String("a") there isn't any delimiter.

        If you add ";" to end of line ( new String("a"); ) everything is OK

        This is strange because ff and chrome dosen't throw any exception.
        But if you try execute this script (without ";") in firebug console you will see exception.

        You can reproduce this bug only with myfaces (in my case 2.1.6 ) without any external libs

        I'll upload test.war if you can't reproduce this bug

        Show
        wojtask added a comment - - edited i forgot to say. <script> var x= new String("a") </script> <script> (1==3)? 'd':'e'; </script> As you can see after new String("a") there isn't any delimiter. If you add ";" to end of line ( new String("a"); ) everything is OK This is strange because ff and chrome dosen't throw any exception. But if you try execute this script (without ";") in firebug console you will see exception. You can reproduce this bug only with myfaces (in my case 2.1.6 ) without any external libs I'll upload test.war if you can't reproduce this bug
        Hide
        Werner Punz added a comment - - edited

        I tried to reproduce this bug with following markup: https://gist.github.com/2291512
        and with MyFaces 2.1.6 and Richfaces 4.2.0-Final. The viewstate was properly set.

        Autoscroll was on.

        Show
        Werner Punz added a comment - - edited I tried to reproduce this bug with following markup: https://gist.github.com/2291512 and with MyFaces 2.1.6 and Richfaces 4.2.0-Final. The viewstate was properly set. Autoscroll was on.
        Hide
        wojtask added a comment -

        yes it's working because you have ";" after new String("a")

        Show
        wojtask added a comment - yes it's working because you have ";" after new String("a")
        Hide
        wojtask added a comment - - edited

        added testcase.

        in browser type localhost:8080/test_js/index.xhtml

        If you add ";" after new String("a") everything works

        To be clear
        I'm not sure is this myfaces bug but with jsf-ri it works.

        Show
        wojtask added a comment - - edited added testcase. in browser type localhost:8080/test_js/index.xhtml If you add ";" after new String("a") everything works To be clear I'm not sure is this myfaces bug but with jsf-ri it works.
        Hide
        Werner Punz added a comment -

        Ok now it is clear... semi clear at least, the javascript error probably causes globaleval to fail and then it bombs out of the response cycle prematurely which means that the response processing is aborted, due to the syntax, error, this should not happen, lets see what I can do

        Show
        Werner Punz added a comment - Ok now it is clear... semi clear at least, the javascript error probably causes globaleval to fail and then it bombs out of the response cycle prematurely which means that the response processing is aborted, due to the syntax, error, this should not happen, lets see what I can do
        Hide
        Werner Punz added a comment -

        After finally finding out what exactly caused the issue, I was able to fix it.

        Show
        Werner Punz added a comment - After finally finding out what exactly caused the issue, I was able to fix it.
        Hide
        Werner Punz added a comment -

        Thanks for reporting the issue.

        Show
        Werner Punz added a comment - Thanks for reporting the issue.
        Hide
        wojtask added a comment -

        thanks for fix

        Show
        wojtask added a comment - thanks for fix

          People

          • Assignee:
            Unassigned
            Reporter:
            wojtask
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development