ICEfaces
  1. ICEfaces
  2. ICE-7105

Myfaces 2 "cannot find enclosing form" on alternate requests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.1-Beta, 3.0
    • Component/s: Bridge, Framework, Sample Apps
    • Labels:
      None
    • Environment:
      ICEfaces 2 MyFaces 2

      Description

      You can reproduce the problem with the core/auction application (I turned off Push to avoid the extra logging and processing). I found that the Chrome console provided the best data as to what was going wrong.

      1) Click on the details triangle for one of the auction items. The details should render without any errors.
      2) Click on the details triangle again. No request is sent, the details line does not get closed, and the following error is dumped out to the Chrome console:

      "Uncaught cannot find enclosing form"

      3) Click on the details triangle again. This time it works properly.

      Alternating clicks will work/fail in the same way.

        Issue Links

          Activity

          Deryk Sinotte created issue -
          Hide
          Deryk Sinotte added a comment -

          Attached a screenshot of the Chrome console and stack when the error occurs.

          Show
          Deryk Sinotte added a comment - Attached a screenshot of the Chrome console and stack when the error occurs.
          Deryk Sinotte made changes -
          Field Original Value New Value
          Attachment myfaces-find-form.png [ 13404 ]
          Hide
          Deryk Sinotte added a comment -

          Linking to the parent JIRA for MyFaces 2 compatibility.

          Show
          Deryk Sinotte added a comment - Linking to the parent JIRA for MyFaces 2 compatibility.
          Deryk Sinotte made changes -
          Link This issue blocks ICE-5868 [ ICE-5868 ]
          Deryk Sinotte made changes -
          Assignee Deryk Sinotte [ deryk.sinotte ]
          Hide
          Deryk Sinotte added a comment -

          The debugging gets pretty nasty with the functions and closures and such. The general problem is that when the <a> anchor wrapped around the image is clicked, the parent form cannot be found. This only occurs after a successful update has been applied which is why it alternating clicks succeed/fail/succeed/fail, etc.

          Perhaps when the update gets applied, a listener or handler doesn't get properly re-registered.

          Show
          Deryk Sinotte added a comment - The debugging gets pretty nasty with the functions and closures and such. The general problem is that when the <a> anchor wrapped around the image is clicked, the parent form cannot be found. This only occurs after a successful update has been applied which is why it alternating clicks succeed/fail/succeed/fail, etc. Perhaps when the update gets applied, a listener or handler doesn't get properly re-registered.
          Hide
          Deryk Sinotte added a comment -

          We submitted a table updating fix to Mojarra, this may be related here as well.

          Show
          Deryk Sinotte added a comment - We submitted a table updating fix to Mojarra, this may be related here as well.
          Hide
          Deryk Sinotte added a comment -

          Verify that this may be similar to the same table update issue we had with Mojarra. Open a JIRA an provide a patch if necessary.

          Show
          Deryk Sinotte added a comment - Verify that this may be similar to the same table update issue we had with Mojarra. Open a JIRA an provide a patch if necessary.
          Deryk Sinotte made changes -
          Assignee Deryk Sinotte [ deryk.sinotte ] Mircea Toma [ mircea.toma ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #25216 Tue Aug 09 08:41:26 MDT 2011 mircea.toma ICE-7105 Fallback to using form as submitting element when the element was removed by a previous update and form.onsubmit callback is called directly (by application or third party library code).
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
          Hide
          Mircea Toma added a comment -

          The issue occurs when the element triggering the submission is captured by our form AJAX hijacking in the 'onsubmit' handler but the form is instead submitted by MyFaces JS code using form's 'submit' function. When another submit is triggered in the same form MyFaces will invoke the 'onsubmit' callback because now it's defined. The element captured in the 'onsubmit' callback during the previous submit is not attached to the document anymore, hence the failure of finding the parent form.

          Show
          Mircea Toma added a comment - The issue occurs when the element triggering the submission is captured by our form AJAX hijacking in the 'onsubmit' handler but the form is instead submitted by MyFaces JS code using form's 'submit' function. When another submit is triggered in the same form MyFaces will invoke the 'onsubmit' callback because now it's defined. The element captured in the 'onsubmit' callback during the previous submit is not attached to the document anymore, hence the failure of finding the parent form.
          Hide
          Mircea Toma added a comment -

          Fallback to using form as submitting element when the element was removed by a previous update and form.onsubmit callback is called directly (by application or third party library code).

          Show
          Mircea Toma added a comment - Fallback to using form as submitting element when the element was removed by a previous update and form.onsubmit callback is called directly (by application or third party library code).
          Mircea Toma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s 2.1-Beta [ 10291 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: