ICEfaces
  1. ICEfaces
  2. ICE-9355

Warnings logged to client when namespace.captureSubmit fails to find our hidden forms

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3, EE-3.3.0.GA
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Portals
    • Assignee Priority:
      P2

      Description

      The problem is the following is logged to the browser's client console (this is from Chrome, other browsers may report it differently):

      Uncaught TypeError: Cannot read property 'submit' of null

      The error occurs in this function:

          namespace.captureSubmit = function(id) {
              var f = document.getElementById(id);
              f.nativeSubmit = f.submit;
      ...

      The id passed in is non-null but doesn't match anything in the current page. I'm unable to see any functional impact - perhaps because captureSubmit isn't necessary for those hidden forms?

      The problem is intermittent and doesn't happen every time but to reproduce I have several different portal pages with multiple portlets. I interact with one or more portlets on a page and then move to a different page. Repeating this eventually shows the issue.

        Activity

        Hide
        Deryk Sinotte added a comment - - edited

        Further analysis shows that the captureSubmit is run against each form on the page. Usually the ids match and everything is fine but when the problem occurs, it inevitably can't find our two hidden forms for each portlet. The ids that are being used don't match the ids for each hidden form so it reports the error twice for each portlet. For example:

        ICE: found element for id A4068:form 
        ICE: found element for id A4068:form2 
        
        ICE: can't find element for id v7ry4tl1r-retrieve-update 
        Uncaught TypeError: Cannot read property 'submit' of null 
        namespace.captureSubmit 
        
        ICE: can't find element for id v7ry4tl1r-single-submit 
        Uncaught TypeError: Cannot read property 'submit' of null
        
        ICE: found element for id A7363:inputForm 
        
        ICE: can't find element for id v7ry4tl1n-retrieve-update 
        Uncaught TypeError: Cannot read property 'submit' of null
        
        ICE: can't find element for id v7ry4tl1n-single-submit 
        Uncaught TypeError: Cannot read property 'submit' of null
        
        ICE: found element for id A6702:canvasForm 
        
        ICE: can't find element for id v7ry4tl1o-retrieve-update 
        Uncaught TypeError: Cannot read property 'submit' of null 
        
        ICE: can't find element for id v7ry4tl1o-single-submit 
        Uncaught TypeError: Cannot read property 'submit' of null 
        
        ICE: found element for id A1338:form 
        
        ICE: can't find element for id v7ry4tl1q-retrieve-update 
        Uncaught TypeError: Cannot read property 'submit' of null
        
        ICE: can't find element for id v7ry4tl1q-single-submit 
        Uncaught TypeError: Cannot read property 'submit' of null 
        
        ICE: found element for id A3252:form 
        
        ICE: can't find element for id v7ry4tl1p-retrieve-update 
        Uncaught TypeError: Cannot read property 'submit' of null 
        
        ICE: can't find element for id v7ry4tl1p-single-submit 
        Uncaught TypeError: Cannot read property 'submit' of null 
        
        ICE: found element for id A1484:form 
        ICE: found element for id v7ry4tl2z-retrieve-update 
        ICE: found element for id v7ry4tl2z-single-submit 
        

        The values of our hidden form ids on the page at the time are actually:

        A4068:form
        A4068:form2
        v7ry4tl34-retrieve-update
        v7ry4tl34-single-submit
        A7363:inputForm
        v7ry4tl30-retrieve-update
        v7ry4tl30-single-submit
        A6702:canvasForm
        v7ry4tl31-retrieve-update
        v7ry4tl31-single-submit
        A1338:form
        v7ry4tl33-retrieve-update
        v7ry4tl33-single-submit
        A3252:form
        v7ry4tl32-retrieve-update
        v7ry4tl32-single-submit
        A1484:form
        v7ry4tl2z-retrieve-update
        v7ry4tl2z-single-submit
        

        It seems as if the values in the scripts that do the captureSubmit are old values - but only for the hidden forms.

        Show
        Deryk Sinotte added a comment - - edited Further analysis shows that the captureSubmit is run against each form on the page. Usually the ids match and everything is fine but when the problem occurs, it inevitably can't find our two hidden forms for each portlet. The ids that are being used don't match the ids for each hidden form so it reports the error twice for each portlet. For example: ICE: found element for id A4068:form ICE: found element for id A4068:form2 ICE: can't find element for id v7ry4tl1r-retrieve-update Uncaught TypeError: Cannot read property 'submit' of null namespace.captureSubmit ICE: can't find element for id v7ry4tl1r-single-submit Uncaught TypeError: Cannot read property 'submit' of null ICE: found element for id A7363:inputForm ICE: can't find element for id v7ry4tl1n-retrieve-update Uncaught TypeError: Cannot read property 'submit' of null ICE: can't find element for id v7ry4tl1n-single-submit Uncaught TypeError: Cannot read property 'submit' of null ICE: found element for id A6702:canvasForm ICE: can't find element for id v7ry4tl1o-retrieve-update Uncaught TypeError: Cannot read property 'submit' of null ICE: can't find element for id v7ry4tl1o-single-submit Uncaught TypeError: Cannot read property 'submit' of null ICE: found element for id A1338:form ICE: can't find element for id v7ry4tl1q-retrieve-update Uncaught TypeError: Cannot read property 'submit' of null ICE: can't find element for id v7ry4tl1q-single-submit Uncaught TypeError: Cannot read property 'submit' of null ICE: found element for id A3252:form ICE: can't find element for id v7ry4tl1p-retrieve-update Uncaught TypeError: Cannot read property 'submit' of null ICE: can't find element for id v7ry4tl1p-single-submit Uncaught TypeError: Cannot read property 'submit' of null ICE: found element for id A1484:form ICE: found element for id v7ry4tl2z-retrieve-update ICE: found element for id v7ry4tl2z-single-submit The values of our hidden form ids on the page at the time are actually: A4068:form A4068:form2 v7ry4tl34-retrieve-update v7ry4tl34-single-submit A7363:inputForm v7ry4tl30-retrieve-update v7ry4tl30-single-submit A6702:canvasForm v7ry4tl31-retrieve-update v7ry4tl31-single-submit A1338:form v7ry4tl33-retrieve-update v7ry4tl33-single-submit A3252:form v7ry4tl32-retrieve-update v7ry4tl32-single-submit A1484:form v7ry4tl2z-retrieve-update v7ry4tl2z-single-submit It seems as if the values in the scripts that do the captureSubmit are old values - but only for the hidden forms.
        Hide
        Deryk Sinotte added a comment -

        Confirmed that this behaviour occurs when running with either Mojarra and MyFaces.

        Show
        Deryk Sinotte added a comment - Confirmed that this behaviour occurs when running with either Mojarra and MyFaces.
        Hide
        Mircea Toma added a comment -

        Is "showcase" portlets good enough for reproducing this issue?

        Show
        Mircea Toma added a comment - Is "showcase" portlets good enough for reproducing this issue?
        Hide
        Deryk Sinotte added a comment -

        Yes, showcase-portlets was what I was using. It's intermittent unfortunately but:

        1. Create 2-3 portal pages
        2. Add a couple of portlets to each page
        3. Interact with one or more portlets on one of the pages you created.
        4. Click a tab to go to one of the other pages you created.
        5. Repeat steps 3 and 4 until you see the issue on in the client's logging console.
        Show
        Deryk Sinotte added a comment - Yes, showcase-portlets was what I was using. It's intermittent unfortunately but: Create 2-3 portal pages Add a couple of portlets to each page Interact with one or more portlets on one of the pages you created. Click a tab to go to one of the other pages you created. Repeat steps 3 and 4 until you see the issue on in the client's logging console.
        Hide
        Mircea Toma added a comment -

        To reproduce this issue is enough to rapidly switch the portlet page tabs.
        It can be observed that when the error occurs the ID passed into the ice.captureSubmit does not correspond to any form (or element) present in the page. Debugging the server side rendering shows that the inline script that calls the ice.captureSubmit is rendered with the correct form ID.

        Show
        Mircea Toma added a comment - To reproduce this issue is enough to rapidly switch the portlet page tabs. It can be observed that when the error occurs the ID passed into the ice.captureSubmit does not correspond to any form (or element) present in the page. Debugging the server side rendering shows that the inline script that calls the ice.captureSubmit is rendered with the correct form ID.
        Hide
        Mircea Toma added a comment -

        To workaround this mysterious problem we decided to just avoid capturing the form submit for *-retrieve-update and *-single-submit hidden since they are used only by ICEfaces bridge.

        Show
        Mircea Toma added a comment - To workaround this mysterious problem we decided to just avoid capturing the form submit for *-retrieve-update and *-single-submit hidden since they are used only by ICEfaces bridge.
        Hide
        Mircea Toma added a comment -

        The form components *-retrieve-update and *-single-submit added to the component tree are now marked with DISABLE_CAPTURE_SUBMIT attribute to disable the capture submit feature for them.

        Show
        Mircea Toma added a comment - The form components *-retrieve-update and *-single-submit added to the component tree are now marked with DISABLE_CAPTURE_SUBMIT attribute to disable the capture submit feature for them.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: