ICEfaces
  1. ICEfaces
  2. ICE-5211

Gmap doesn't work under compat

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha1
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Gmap
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial

      Description

      Joanne Bai wrote:
      > Glimmer/Compat revision #19959
      > Server tested: Tomcat 6
      > Browser tested: FF3.5


      >Components that are not available at all

      >- File Upload
      >- Google Map
      >- Data Exporter

        Issue Links

          Activity

          Hide
          Judy Guglielmin added a comment -

          with the attempt to load the javascript in the constructor of Gmap(), problems occur within icefaces-compat.js at the following line:-

          new ActiveXObject('Microsoft.XMLHTTP');

          as well as getting state saving issue (as reported by Adnan above). that's just in loading the application itselft. Can step over that and then why trying to load gmap page get the following:-

          com.sun.faces.application.view.StateHolderSaver
          class java.lang.ClassCastException

          switched to try and load from "head" to "body", but still got same exception.

          Try to load the script tag in the Renderer, but what happens if you have multiple gmap components on same page?

          Show
          Judy Guglielmin added a comment - with the attempt to load the javascript in the constructor of Gmap(), problems occur within icefaces-compat.js at the following line:- new ActiveXObject('Microsoft.XMLHTTP'); as well as getting state saving issue (as reported by Adnan above). that's just in loading the application itselft. Can step over that and then why trying to load gmap page get the following:- com.sun.faces.application.view.StateHolderSaver class java.lang.ClassCastException switched to try and load from "head" to "body", but still got same exception. Try to load the script tag in the Renderer, but what happens if you have multiple gmap components on same page?
          Hide
          Judy Guglielmin added a comment -

          server exception:-

          javax.faces.FacesException: Unexpected error restoring state for component with id javax_faces_location_BODY. Cause: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver.
          at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:250)
          at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:147)
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1476)
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487)
          at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:234)
          at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
          at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
          at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:438)
          at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:144)
          at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:182)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
          at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
          at java.lang.Thread.run(Thread.java:613)
          Caused by: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver
          at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1422)
          at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:242)
          ... 25 more

          Show
          Judy Guglielmin added a comment - server exception:- javax.faces.FacesException: Unexpected error restoring state for component with id javax_faces_location_BODY. Cause: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver. at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:250) at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:147) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1476) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1487) at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:234) at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177) at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119) at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:438) at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:144) at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:182) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:613) Caused by: java.lang.ClassCastException: com.sun.faces.application.view.StateHolderSaver at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1422) at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:242) ... 25 more
          Hide
          Ken Fyten added a comment -

          For Gmap compat, need to inject it's external JS link in the body section when it is rendered to the page. This technique also needs to ensure that it is only added once per page, so first one wins, and the subsequent gmaps just check to see if the link is already there (and then do not add it again themselves).

          Show
          Ken Fyten added a comment - For Gmap compat, need to inject it's external JS link in the body section when it is rendered to the page. This technique also needs to ensure that it is only added once per page, so first one wins, and the subsequent gmaps just check to see if the link is already there (and then do not add it again themselves).
          Hide
          Judy Guglielmin added a comment -

          the problem with state-saving is the component.addResource call, so remove it and just add script tag.
          However, in the GMap class, encodeBegin(), this just puts the tag within the gmap container and for it to be loaded, the script tag needs to be closed before the beginning of the gmap container. Will try to do this in the renderer class before using a script renderer which listens for the gmap class (using ComponentSystemEventListener)

          Show
          Judy Guglielmin added a comment - the problem with state-saving is the component.addResource call, so remove it and just add script tag. However, in the GMap class, encodeBegin(), this just puts the tag within the gmap container and for it to be loaded, the script tag needs to be closed before the beginning of the gmap container. Will try to do this in the renderer class before using a script renderer which listens for the gmap class (using ComponentSystemEventListener)
          Hide
          Ken Fyten added a comment -

          Fixed.

          Show
          Ken Fyten added a comment - Fixed.

            People

            • Assignee:
              Judy Guglielmin
              Reporter:
              Adnan Durrani
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: