MyFaces Core
  1. MyFaces Core
  2. MYFACES-3408

ajax behaviour has changed within myfaces-2.1.4

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: 2.0.11, 2.1.5
    • Component/s: None
    • Labels:
      None

      Description

      Example site:

      <!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"
      xmlns:ui="http://java.sun.com/jsf/facelets">

      <h:head>
      <title>JSF Test</title>
      </h:head>

      <h:body>
      <h:form id="testForm">
      <h:commandButton id="buttonId" value="click me">
      <f:ajax event="click" execute="@this" render="textId" />
      </h:commandButton>
      <h:outputText id="textId" value="Test" />
      </h:form>
      </h:body>
      </html>

      If you click the button, the following happens (you can see this if you use the richfaces a4j:log component):
      myfaces-2.1.4:
      info [20:19:52.375]: Received 'begin' event from <input id=testForm:buttonId ...>
      info [20:19:52.421]: Received 'beforedomupdate' event from <input id=testForm:buttonId ...>
      info [20:19:52.453]: Received 'success' event from <input id=testForm:buttonId ...>
      info [20:19:52.453]: Received 'complete' event from <input id=testForm:buttonId ...>

      but with myfaces-2.1.3 and mojarra-2.1.4:
      info [20:23:57.671]: Received 'begin' event from <input id=testForm:buttonId ...>
      info [20:23:57.828]: Received 'beforedomupdate' event from <input id=testForm:buttonId ...>
      info [20:23:57.843]: Listing content of response changes element:
      Element update for id=testForm:textId
      <update id="testForm:textId"><![CDATA[<span id="testForm:textId">Test</span>]]></update>
      Element update for id=javax.faces.ViewState
      <update id="javax.faces.ViewState"><![CDATA[j0LjX8e0GxCO+29xvrdy2+8Ioe6Fl0/0rxQEZOOH3gbOawFqNemG/u0qOkv8g9mdmT4e8Zt3Qd+VmBXTz7ibVDKOj1kPnFKT+11GTlQ4BRvtRAGk9ioKZSuzhTbGgPwzW+4BMw==]]></update>

      You see, that now with myfaces-2.1.4 something goes wrong...
      This new behaviour causes some problems within richfaces. For example the rich:tabPanel component doesn't work correct now, if used in ajax mode.

        Activity

        Hide
        Leonardo Uribe added a comment -

        I tried the example and it works fine with 2.1.4. The response looks like this:

        <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="testForm:textId"><Unable to render embedded object: File (textId">Test</span>]]></update><update id="javax.faces.ViewState"><) not found.[CDATA[7De+xaILCuzOSe3wa9EceIRbeW6StpVz7BddNI1saPfMuvnBtxg0NFHWNz7DBRCCi7X7VwYCa55S
        UyMfieh26A9AB6VNvsEEfNzJp2P8tDfQ7f5cMmZNOFClaQBvkRBLJwwQpA==
        ]]></update></changes></partial-response>

        Which is ok, the span and the state are updated. In 2.1.4 we did some changes related to MYFACES-3339 and MYFACES-3321. Checking the code I don't see any error. Could you provide an alternate example? 2.1.5 quick bug fix release is on the way right now, so if there is a test case maybe this could be included in that release.

        Show
        Leonardo Uribe added a comment - I tried the example and it works fine with 2.1.4. The response looks like this: <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="testForm:textId">< Unable to render embedded object: File (textId">Test</span>]]></update><update id="javax.faces.ViewState"><) not found. [CDATA[7De+xaILCuzOSe3wa9EceIRbeW6StpVz7BddNI1saPfMuvnBtxg0NFHWNz7DBRCCi7X7VwYCa55S UyMfieh26A9AB6VNvsEEfNzJp2P8tDfQ7f5cMmZNOFClaQBvkRBLJwwQpA== ]]></update></changes></partial-response> Which is ok, the span and the state are updated. In 2.1.4 we did some changes related to MYFACES-3339 and MYFACES-3321 . Checking the code I don't see any error. Could you provide an alternate example? 2.1.5 quick bug fix release is on the way right now, so if there is a test case maybe this could be included in that release.
        Hide
        Rene O added a comment -

        Testcase with myfaces-2.1.4 and Richfaces 4.1.0-CR1

        http://localhost:8080/jsf2testcase/tabpanel.jsf

        Just click the tabs to see, what happens.

        myfaces-2.1.4:
        tabs are not rendered correctly

        myfaces-2.1.3 and mojarra-2.1.4:
        tabs are rendered correctly

        To test this behaviour with myfaces-2.1.3 or mojarra-2.1.4, just replace the jsf libs inside the war-archive.

        Show
        Rene O added a comment - Testcase with myfaces-2.1.4 and Richfaces 4.1.0-CR1 http://localhost:8080/jsf2testcase/tabpanel.jsf Just click the tabs to see, what happens. myfaces-2.1.4: tabs are not rendered correctly myfaces-2.1.3 and mojarra-2.1.4: tabs are rendered correctly To test this behaviour with myfaces-2.1.3 or mojarra-2.1.4, just replace the jsf libs inside the war-archive.
        Hide
        Werner Punz added a comment - - edited

        Ok I tried the tab element, the weird thing happening here is the response, if I press tab b then following happens as response http://localhost:8080/jsf2testcase/myfaces.jsf:
        <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="testForm:tabB"><Unable to render embedded object: File (tabB" style="display:none;"></div>]]></update><update id="javax.faces.ViewState"><) not found.[CDATA[F/9NbnMcQpZBBc5rlPv8/8HwGuZxthlMF0S5KUBqkrbrp6vc1sc/ZRV3y4NaE1n0BhPWsQUPT36DUJIAbLWZ2DvuMrWvccogKkK8LcXU5UUb7+UhDUmac06VUUzL5yqf33KGqA==]]></update><extension id="org.richfaces.extension"><complete>RichFaces.$('testForm:tabPanel').onCompleteHandler('tabB');;</complete></extension></changes></partial-response>

        I think this might be a client side issue, I have to debug into the extension mechanism, the update seems to be correct but for whatever reson the extension is not triggering here, which should switch to tab b.

        Show
        Werner Punz added a comment - - edited Ok I tried the tab element, the weird thing happening here is the response, if I press tab b then following happens as response http://localhost:8080/jsf2testcase/myfaces.jsf: <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="testForm:tabB">< Unable to render embedded object: File (tabB" style="display:none;"></div>]]></update><update id="javax.faces.ViewState"><) not found. [CDATA [F/9NbnMcQpZBBc5rlPv8/8HwGuZxthlMF0S5KUBqkrbrp6vc1sc/ZRV3y4NaE1n0BhPWsQUPT36DUJIAbLWZ2DvuMrWvccogKkK8LcXU5UUb7+UhDUmac06VUUzL5yqf33KGqA==] ]></update><extension id="org.richfaces.extension"><complete>RichFaces.$('testForm:tabPanel').onCompleteHandler('tabB');;</complete></extension></changes></partial-response> I think this might be a client side issue, I have to debug into the extension mechanism, the update seems to be correct but for whatever reson the extension is not triggering here, which should switch to tab b.
        Hide
        Werner Punz added a comment - - edited

        Ok it seems to be a refactoring error, the complete data should have a response text and response xml already present if the complete has been done, otherwise the richfaces init code is omitted, seems like we introduced this bug in the latest refactoring which cleaned up the xhr code the data there is transferred to late.
        I will fix it asap and will add testcases which test accordingly that the data passed down the complete event has the responseText and responseXML set.
        My apologies for the hazzle, the refactoring was unfortunately necessary to make the code more maintainable.

        Show
        Werner Punz added a comment - - edited Ok it seems to be a refactoring error, the complete data should have a response text and response xml already present if the complete has been done, otherwise the richfaces init code is omitted, seems like we introduced this bug in the latest refactoring which cleaned up the xhr code the data there is transferred to late. I will fix it asap and will add testcases which test accordingly that the data passed down the complete event has the responseText and responseXML set. My apologies for the hazzle, the refactoring was unfortunately necessary to make the code more maintainable.
        Hide
        Werner Punz added a comment -

        Ok I found the issue, it was a type error in the code part where I transfer the request values from the core XHR object to our wrapper which emulates the xhr level2 api. I will fix it today and commit the fix.

        Show
        Werner Punz added a comment - Ok I found the issue, it was a type error in the code part where I transfer the request values from the core XHR object to our wrapper which emulates the xhr level2 api. I will fix it today and commit the fix.
        Hide
        Werner Punz added a comment - - edited

        resolved the issue, the example now works again.
        Added a regression test to http://code.google.com/a/apache-extras.org/p/myfaces-js-integrationtests/
        the error wont ever be made again.

        Show
        Werner Punz added a comment - - edited resolved the issue, the example now works again. Added a regression test to http://code.google.com/a/apache-extras.org/p/myfaces-js-integrationtests/ the error wont ever be made again.
        Hide
        Werner Punz added a comment -

        Hi please can you test if the latest head now works sufficiently again, the error you discovered now is solved, but you might have a better overview of your testcases and could point me maybe towards other errors.

        Show
        Werner Punz added a comment - Hi please can you test if the latest head now works sufficiently again, the error you discovered now is solved, but you might have a better overview of your testcases and could point me maybe towards other errors.
        Hide
        Rene O added a comment -

        I have tested with the latest jars from repository (myfaces-api-2.1.6-20111126.150252-11.jar and myfaces-impl-2.1.6-20111126.150256-11.jar) and now it works as expected. At first view no others bugs related to this issue exists.
        Thanks for fixing this issue so fast.

        Show
        Rene O added a comment - I have tested with the latest jars from repository (myfaces-api-2.1.6-20111126.150252-11.jar and myfaces-impl-2.1.6-20111126.150256-11.jar) and now it works as expected. At first view no others bugs related to this issue exists. Thanks for fixing this issue so fast.

          People

          • Assignee:
            Unassigned
            Reporter:
            Rene O
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development