ICEfaces
  1. ICEfaces
  2. ICE-9596

<f:ajax> not functioning correctly with Myfaces in IE7/8

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.BETA
    • Fix Version/s: 4.0.BETA, EE-3.3.0.GA_P02, 4.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Icefaces3 trunk revision #38050
      IE 7/8
    • Assignee Priority:
      P2

      Description

      <f:ajax> tag isn't functioning correctly in IE7/8. For example, de-selecting a checkbox doesn't do anything until clicking once again somewhere on the page, or pressing enter. This can be reproduced in our dateTimeEntry test application.

      1) Build / deploy test app located at: http://server.ice:8888/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/dateTimeEntry
      2) Navigate to 'DateTimeEntry Attribute' attribute test in IE7 or IE8
      3) Click the rendered checkbox (notice the calendar is still rendered)
      4) Click somewhere else on the page or press enter. The submit will occur.

        Activity

        Cruz Miraback created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Assignee Mircea Toma [ mircea.toma ]
        Assignee Priority P2 [ 10011 ]
        Hide
        Mircea Toma added a comment -

        I cannot reproduce the issue because an exception is thrown on the server when interacting with any of the widgets on the page:

        java.lang.IllegalStateException: component with duplicate id "j_id__v_16" found
        	at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIdsStatefulComponents(CheckDuplicateIdFaceletUtils.java:54)
        	at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIdsStatefulComponents(CheckDuplicateIdFaceletUtils.java:75)
        	at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIdsStatefulComponents(CheckDuplicateIdFaceletUtils.java:66)
        	at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIdsStatefulComponents(CheckDuplicateIdFaceletUtils.java:35)
        	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.saveView(DefaultFaceletsStateManagementStrategy.java:583)
        	at org.apache.myfaces.application.StateManagerImpl.saveView(StateManagerImpl.java:188)
        	at javax.faces.application.StateManager.getViewState(StateManager.java:257)
        	at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:277)
        	at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:422)
        	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
        	at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1958)
        	at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:293)
        	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
        	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:116)
        	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:267)
        	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:201)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
        	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
        	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
        	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279)
        	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
        	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        	at java.lang.Thread.run(Thread.java:680)
        
        Show
        Mircea Toma added a comment - I cannot reproduce the issue because an exception is thrown on the server when interacting with any of the widgets on the page: java.lang.IllegalStateException: component with duplicate id "j_id__v_16" found at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIdsStatefulComponents(CheckDuplicateIdFaceletUtils.java:54) at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIdsStatefulComponents(CheckDuplicateIdFaceletUtils.java:75) at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIdsStatefulComponents(CheckDuplicateIdFaceletUtils.java:66) at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIdsStatefulComponents(CheckDuplicateIdFaceletUtils.java:35) at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.saveView(DefaultFaceletsStateManagementStrategy.java:583) at org.apache.myfaces.application.StateManagerImpl.saveView(StateManagerImpl.java:188) at javax.faces.application.StateManager.getViewState(StateManager.java:257) at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:277) at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:422) at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1958) at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:293) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59) at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:116) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:267) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:201) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang. Thread .run( Thread .java:680)
        Hide
        Mircea Toma added a comment -

        Fixed the exception above by assigning IDs to transient components, JavaScriptContextSetup and JavascriptRunnerSetup that is.

        Show
        Mircea Toma added a comment - Fixed the exception above by assigning IDs to transient components, JavaScriptContextSetup and JavascriptRunnerSetup that is.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #38225 Thu Sep 19 10:46:44 MDT 2013 mircea.toma ICE-9596 Assign ID for transient component to avoid duplicate ID exceptions in Myfaces.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/JavaScriptRunnerSetup.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/component/JavaScriptContextSetup.java
        Hide
        Mircea Toma added a comment -

        The checkboxes rendered by h:selectBooleanCheckbox use the onchange event handler to submit back the form. Unfortunately IE8 will trigger change event only after the checkbox looses focus. This explain why the calendar rendering is toggled only when clicking somewhere on the page.
        See:
        http://stackoverflow.com/questions/3117716/onchange-onclick-in-a-checkbox-doesnt-work-in-ie

        Show
        Mircea Toma added a comment - The checkboxes rendered by h:selectBooleanCheckbox use the onchange event handler to submit back the form. Unfortunately IE8 will trigger change event only after the checkbox looses focus. This explain why the calendar rendering is toggled only when clicking somewhere on the page. See: http://stackoverflow.com/questions/3117716/onchange-onclick-in-a-checkbox-doesnt-work-in-ie
        Hide
        Mircea Toma added a comment - - edited

        One of the tricks offered on the web was to capture the click event and then blur and focus back the checkbox, thus triggering the change event. This approach was tested successfully by modifying just the application code:

                        <h:selectBooleanCheckbox id="rendered" value="#{calendarBean.rendered}" onclick="this.blur(); this.focus();"/>
        
        Show
        Mircea Toma added a comment - - edited One of the tricks offered on the web was to capture the click event and then blur and focus back the checkbox, thus triggering the change event. This approach was tested successfully by modifying just the application code: <h:selectBooleanCheckbox id= "rendered" value= "#{calendarBean.rendered}" onclick= " this .blur(); this .focus();" />
        Hide
        Ken Fyten added a comment -

        Assigned to Carmen to adopt the work-around technique in the test page to resolve this issue.

        Show
        Ken Fyten added a comment - Assigned to Carmen to adopt the work-around technique in the test page to resolve this issue.
        Ken Fyten made changes -
        Assignee Mircea Toma [ mircea.toma ] Carmen Cristurean [ ccristurean ]
        Carmen Cristurean made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Liana Munroe added a comment -

        Application code modified and issue is resolved, IE, 7 & 8, Myfaces, revision#38518.

        Show
        Liana Munroe added a comment - Application code modified and issue is resolved, IE, 7 & 8, Myfaces, revision#38518.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Carmen Cristurean [ ccristurean ] Mircea Toma [ mircea.toma ]
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA_P02 [ 11371 ]
        Hide
        Mircea Toma added a comment -

        The applied fix was in QA's test application code. I believe there's not need for backporting the fix then.

        Show
        Mircea Toma added a comment - The applied fix was in QA's test application code. I believe there's not need for backporting the fix then.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Mircea Toma added a comment -

        Backported fix.

        Show
        Mircea Toma added a comment - Backported fix.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 4.0 [ 11382 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Cruz Miraback
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: