ICEfaces
  1. ICEfaces
  2. ICE-6941

toggleOnInput set to true causes unresponsive browser

    Details

    • Assignee Priority:
      P1
    • Workaround Exists:
      Yes
    • Workaround Description:
      Set toggleOnInput to false

      Description

      A row selectable dataTable has a commandLink which opens a popup (either modal or non modal). When the rowSelector attribute toggleOnInput is set to true, the resulting popup displays but the browser appears to hang. This does not occur with toggleOnInput set to false. I see the following JS error in Firebug:

      element is null
      return parentStream(element.parentNode);

      coming from our bridge code here:

      function parents(element) {
      return Stream(function(cellConstructor) {
      function parentStream(e) {
      if (e == null || e == document) return null;
      return function() {
      return cellConstructor(e, parentStream(e.parentNode));
      };
      }
      return parentStream(element.parentNode);
      });
      }

      Test case attached.

        Activity

        Hide
        yip.ng added a comment -

        Can't reproduce in FF or IE, ICEfaces 1.8 or 2, modal or nonmodal, draggable or undraggable. See video at http://screencast.com/t/D5ABowoLB

        Show
        yip.ng added a comment - Can't reproduce in FF or IE, ICEfaces 1.8 or 2, modal or nonmodal, draggable or undraggable. See video at http://screencast.com/t/D5ABowoLB
        Hide
        yip.ng added a comment -

        From Tyler:

        Did you try with the attached test case? I was able to reproduce it reliably. Test case intended for deployment on Tomcat 6.

        Show
        yip.ng added a comment - From Tyler: Did you try with the attached test case? I was able to reproduce it reliably. Test case intended for deployment on Tomcat 6.
        Hide
        yip.ng added a comment -

        Transplanted code into component showcase and ran in Tomcat 7. See video posted above. Will set up webapp project separately and try again.

        Show
        yip.ng added a comment - Transplanted code into component showcase and ran in Tomcat 7. See video posted above. Will set up webapp project separately and try again.
        Hide
        yip.ng added a comment - - edited

        See screenshot 2 for the chain of calls that lead to error.

        Show
        yip.ng added a comment - - edited See screenshot 2 for the chain of calls that lead to error.
        Hide
        yip.ng added a comment - - edited

        Seems on an ajax submit send the bridge is executing a listener which requests the view id of the event source, but somehow the event source element has become null.

        Show
        yip.ng added a comment - - edited Seems on an ajax submit send the bridge is executing a listener which requests the view id of the event source, but somehow the event source element has become null.
        Hide
        Mircea Toma added a comment -

        When javax,faces.request function is invoked it tries to lookup the source element by using its ID (passed in as parameter). If the source element does not have an ID the lookup will return the null value. The callback registered by ICEfaces/compat then tries to use the source object to find the bridge bridge configuration, but fails because the passed in source element is null.

        The fix changes the TableRenderer to assign an ID to the hidden input element used as submit source to allow JSF submit to lookup the element.

        Show
        Mircea Toma added a comment - When javax,faces.request function is invoked it tries to lookup the source element by using its ID (passed in as parameter). If the source element does not have an ID the lookup will return the null value. The callback registered by ICEfaces/compat then tries to use the source object to find the bridge bridge configuration, but fails because the passed in source element is null. The fix changes the TableRenderer to assign an ID to the hidden input element used as submit source to allow JSF submit to lookup the element.
        Hide
        Ken Fyten added a comment -

        As a result of this change, the regression-test for ICE-2024 is failing. Row selection is not reset anymore when multiple row selection checkbox is checked or unchecked (and should be).

        Testcase is available at 'svn\repo\qa\trunk\Regression-Icefaces2\Nightly\ICE-2024'.

        The testcase first started failing on icefaces-2.0.x-maintenance/icefaces revision# 24828

        Yip has confirmed that backing out the commit for this issue resolved the issue.

        Show
        Ken Fyten added a comment - As a result of this change, the regression-test for ICE-2024 is failing. Row selection is not reset anymore when multiple row selection checkbox is checked or unchecked (and should be). Testcase is available at 'svn\repo\qa\trunk\Regression-Icefaces2\Nightly\ ICE-2024 '. The testcase first started failing on icefaces-2.0.x-maintenance/icefaces revision# 24828 Yip has confirmed that backing out the commit for this issue resolved the issue.
        Hide
        Mircea Toma added a comment -

        The last issue is triggered when Ice.tableRowClicked clears the "id" attribute of the hidden input element and later the DOM update tries to apply an update to the same element but fails to find the element in the document (JSF throws a "malformedXML" error).
        The clearing of the "id" attribute goes back to ICE-2874 where the "trick" was used to avoid the deselection of the last row when any other action in the page was triggered.

        After removing the clearing of the "id" and testing again I could not detect any change in behavior of the datatable except the fixing of the JS error. So this was the applied fix. The fix for any regression detected in the future should try to keep in sync the browser DOM with the server side DOM in order to avoid exactly this kind of problems.

        Show
        Mircea Toma added a comment - The last issue is triggered when Ice.tableRowClicked clears the "id" attribute of the hidden input element and later the DOM update tries to apply an update to the same element but fails to find the element in the document (JSF throws a "malformedXML" error). The clearing of the "id" attribute goes back to ICE-2874 where the "trick" was used to avoid the deselection of the last row when any other action in the page was triggered. After removing the clearing of the "id" and testing again I could not detect any change in behavior of the datatable except the fixing of the JS error. So this was the applied fix. The fix for any regression detected in the future should try to keep in sync the browser DOM with the server side DOM in order to avoid exactly this kind of problems.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: