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

        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.
        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.
        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.
        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.
        Hide
        Mircea Toma added a comment -

        Backported fix.

        Show
        Mircea Toma added a comment - Backported fix.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: