ICEfaces
  1. ICEfaces
  2. ICE-7324

icecore:singleSubmit causing StackOverflow when used with h:inputText (ui:debug issue)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta
    • Fix Version/s: 2.1-Beta2, 3.0
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      ICEfaces2 com-suite demo using grimlock run #25882
    • Affects:
      Compatibility/Configuration
    • Workaround Exists:
      Yes
    • Workaround Description:
      Workaround is to remove the <ui:debug> tag from the page.

      Description

      The comp-suite ace->dataTable->Scrolling demo page features an h:inputText to set the height of the dataTable. When the user types a value into this h:inputText, it results in the browser failing with a StackOverflow error.

      Here's the URL to the page in the comp-suite demo:
         http://localhost:8080/comp-suite/showcase.jsf?grp=aceMenu&exp=dataTableScrolling

      Here's the snippet of page markup:

      <ui:define name="example">
              <h:form>
                  <icecore:singleSubmit/>
                  <h:panelGrid columns="3">
                      <h:outputLabel for="scrollingIn" value="Enable Scrolling:"/>
                      <h:selectBooleanCheckbox id="scrollingIn" value="#{dataTableScrolling.scrolling}"/>
                      <h:message for="scrollingIn"/>
                      
                      <h:outputLabel for="heightIn" value="Table Height (in pixels):"/>
                      <h:inputText id="heightIn" value="#{dataTableScrolling.height}"
                                   required="true" size="3" maxlength="3"
                                   disabled="#{!dataTableScrolling.scrolling}">
                           <f:validateLongRange minimum="50" maximum="500"/>
                      </h:inputText>
                      <h:message for="heightIn"/>
                  </h:panelGrid>
              </h:form>

      ...and here's the JS error (from Chrome, in this case, but happens in IE7 too and possibly others):

      Uncaught RangeError: Maximum call stack size exceeded
      apply
      obj.(anonymous function)
      document.onkeyup
      apply
      obj.(anonymous function)
      document.onkeyup
      apply
      obj.(anonymous function)
      document.onkeyup
      apply
      ... and so on.

        Activity

        Hide
        Ted Goddard added a comment -

        Adding the following to a modified page in basic works as expected:

        <h:form>
        <icecore:singleSubmit/>
        <h:panelGrid columns="3">
        <h:outputLabel for="scrollingIn" value="Enable Scrolling:"/>
        <h:selectBooleanCheckbox id="scrollingIn" value="#

        {basic.visible}"/>
        <h:message for="scrollingIn"/>

        <h:outputLabel for="heightIn" value="Table Height (in pixels):"/>
        <h:inputText id="heightIn" value="55"
        required="true" size="3" maxlength="3"
        disabled="#{basic.visible}

        ">
        <f:validateLongRange minimum="50" maximum="500"/>
        </h:inputText>
        <h:message for="heightIn"/>
        </h:panelGrid>
        </h:form>

        So there must be an interaction with JavaScript present in the comp-suite demo or icefaces-ace.jar.

        Show
        Ted Goddard added a comment - Adding the following to a modified page in basic works as expected: <h:form> <icecore:singleSubmit/> <h:panelGrid columns="3"> <h:outputLabel for="scrollingIn" value="Enable Scrolling:"/> <h:selectBooleanCheckbox id="scrollingIn" value="# {basic.visible}"/> <h:message for="scrollingIn"/> <h:outputLabel for="heightIn" value="Table Height (in pixels):"/> <h:inputText id="heightIn" value="55" required="true" size="3" maxlength="3" disabled="#{basic.visible} "> <f:validateLongRange minimum="50" maximum="500"/> </h:inputText> <h:message for="heightIn"/> </h:panelGrid> </h:form> So there must be an interaction with JavaScript present in the comp-suite demo or icefaces-ace.jar.
        Hide
        Ted Goddard added a comment -

        The application template contains

        <html xmlns="http://www.w3.org/1999/xhtml"
        ...
        xmlns:ice="http://www.icesoft.com/icefaces/component">
        <ui:insert name="metadata"/>
        <ui:debug/>
        <h:head>

        which results in the following invalid markup due to the debug tag:

        <html xmlns="http://www.w3.org/1999/xhtml"><span id="debugPanel"><script language="javascript" type="text/javascript">//<![CDATA[
        function faceletsDebug(URL)

        { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');"); }

        ;var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e)

        { if (window.event) e = window.event; if (String.fromCharCode(e.keyCode) == 'D' & e.shiftKey & e.ctrlKey) faceletsDebug('/comp-suite/showcase.jsf?facelets.ui.DebugOutput=1318609344159'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); }

        ;
        //]]>
        </script></span><head>

        Show
        Ted Goddard added a comment - The application template contains <html xmlns="http://www.w3.org/1999/xhtml" ... xmlns:ice="http://www.icesoft.com/icefaces/component"> <ui:insert name="metadata"/> <ui:debug/> <h:head> which results in the following invalid markup due to the debug tag: <html xmlns="http://www.w3.org/1999/xhtml"><span id="debugPanel"><script language="javascript" type="text/javascript">//<![CDATA[ function faceletsDebug(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');"); } ;var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e) { if (window.event) e = window.event; if (String.fromCharCode(e.keyCode) == 'D' & e.shiftKey & e.ctrlKey) faceletsDebug('/comp-suite/showcase.jsf?facelets.ui.DebugOutput=1318609344159'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); } ; //]]> </script></span><head>
        Hide
        Ted Goddard added a comment -

        If the icecore:singleSubmit tag is removed, the same browser exception occurs due to the flawed algorithm facelets uses to add the debug tag to the page.

        Show
        Ted Goddard added a comment - If the icecore:singleSubmit tag is removed, the same browser exception occurs due to the flawed algorithm facelets uses to add the debug tag to the page.
        Hide
        Ted Goddard added a comment - - edited

        This bug is not related to <icecore:singleSubmit>, but is caused by a bug in the Facelets <ui:debug> JavaScript. The solution is to either remove the <ui:debug> tag from the template or implement a new ICEfaces version of <ui:debug>.

        Show
        Ted Goddard added a comment - - edited This bug is not related to <icecore:singleSubmit>, but is caused by a bug in the Facelets <ui:debug> JavaScript. The solution is to either remove the <ui:debug> tag from the template or implement a new ICEfaces version of <ui:debug>.
        Hide
        Ken Fyten added a comment -

        Evgheni, please remove the ui:debug tag usage in comp-suite to avoid this issue.

        Show
        Ken Fyten added a comment - Evgheni, please remove the ui:debug tag usage in comp-suite to avoid this issue.

          People

          • Assignee:
            Evgheni Sadovoi
            Reporter:
            Ken Fyten
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: