ICEfaces
  1. ICEfaces
  2. ICE-3915

Cannot create PanelCollapsible component programmatically, receive ClassCastException

    Details

    • Workaround Exists:
      Yes
    • Workaround Description:
      The PanelCollapsible class has a typo when it defines the component type. Instead of defining COMPONENT_TYPE, it defines the public static variable COMPONENET_TYPE. If you use the typo variable, it works.

      Description

      The following line in our application fails:

      PanelCollapsible panel = (PanelCollapsible) FacesContext.getCurrentInstance().getApplication().createComponent(PanelCollapsible.COMPONENT_TYPE);

      The exception received is

      java.lang.ClassCastException: javax.faces.component.UICommand cannot be cast to com.icesoft.faces.component.panelcollapsible.PanelCollapsible
      1. ICE-3915-1.8.2.patch
        4 kB
        Ed Hillmann
      2. issue_ICE_3915_1-7-2-sp1.patch
        10 kB
        Ed Hillmann

        Activity

        Ed Hillmann created issue -
        Hide
        Ed Hillmann added a comment - - edited

        It looks like, when we use the correct variable, it's just creating a UICommand object. Hence, the ClassCastException.

        I scanned through the 1.7.2 SP1 source, and found 11 components that were using the variable name with the typo. When I update the PanelCollapsible source, renaming COMPONENET_TYPE to COMPONENT_TYPE, it works fine.

        I've attached a patch against the 1.7.2 SP1 release of the source that fixes this for the 11 components I found that contained this typo. The patch was built from the icefaces root directory.

        Show
        Ed Hillmann added a comment - - edited It looks like, when we use the correct variable, it's just creating a UICommand object. Hence, the ClassCastException. I scanned through the 1.7.2 SP1 source, and found 11 components that were using the variable name with the typo. When I update the PanelCollapsible source, renaming COMPONENET_TYPE to COMPONENT_TYPE, it works fine. I've attached a patch against the 1.7.2 SP1 release of the source that fixes this for the 11 components I found that contained this typo. The patch was built from the icefaces root directory.
        Hide
        Ed Hillmann added a comment -

        Patch defined against the 1.7.2 SP1 source release.
        Renames COMPONENET_TYPE to COMPONENT_TYPE for the files

        com.icesoft.faces.component.effect.ApplyEffect.java
        com.icesoft.faces.component.gmap.GMap.java
        com.icesoft.faces.component.gmap.GMapControl.java
        com.icesoft.faces.component.gmap.GMapDirection.java
        com.icesoft.faces.component.gmap.GMapGeoX.java
        com.icesoft.faces.component.gmap.GMapLatLng.java
        com.icesoft.faces.component.gmap.GMapLatLngs.java
        com.icesoft.faces.component.gmap.GMapMarker.java
        com.icesoft.faces.component.inputrichtext.InputRichText.java
        com.icesoft.faces.component.panelcollapsible.PanelCollapsible.java
        com.icesoft.faces.component.panelpositioned.PanelPositioned.java

        Show
        Ed Hillmann added a comment - Patch defined against the 1.7.2 SP1 source release. Renames COMPONENET_TYPE to COMPONENT_TYPE for the files com.icesoft.faces.component.effect.ApplyEffect.java com.icesoft.faces.component.gmap.GMap.java com.icesoft.faces.component.gmap.GMapControl.java com.icesoft.faces.component.gmap.GMapDirection.java com.icesoft.faces.component.gmap.GMapGeoX.java com.icesoft.faces.component.gmap.GMapLatLng.java com.icesoft.faces.component.gmap.GMapLatLngs.java com.icesoft.faces.component.gmap.GMapMarker.java com.icesoft.faces.component.inputrichtext.InputRichText.java com.icesoft.faces.component.panelcollapsible.PanelCollapsible.java com.icesoft.faces.component.panelpositioned.PanelPositioned.java
        Ed Hillmann made changes -
        Field Original Value New Value
        Attachment issue_ICE_3915_1-7-2-sp1.patch [ 11423 ]
        Tyler Johnson made changes -
        Salesforce Case [5007000000A77s4]
        Ken Fyten made changes -
        Fix Version/s 1.8.3 [ 10211 ]
        Hide
        Ed Hillmann added a comment -

        I've re-built the patch containing these changes against the 1.8.2 source code. The list of files changed is reduced to five:

        component/src/com/icesoft/faces/component/effect/ApplyEffect.java
        component/src/com/icesoft/faces/component/gmap/GMap.java
        component/src/com/icesoft/faces/component/inputrichtext/InputRichText.java
        component/src/com/icesoft/faces/component/panelcollapsible/PanelCollapsible.java
        component/src/com/icesoft/faces/component/panelpositioned/PanelPositioned.java

        Show
        Ed Hillmann added a comment - I've re-built the patch containing these changes against the 1.8.2 source code. The list of files changed is reduced to five: component/src/com/icesoft/faces/component/effect/ApplyEffect.java component/src/com/icesoft/faces/component/gmap/GMap.java component/src/com/icesoft/faces/component/inputrichtext/InputRichText.java component/src/com/icesoft/faces/component/panelcollapsible/PanelCollapsible.java component/src/com/icesoft/faces/component/panelpositioned/PanelPositioned.java
        Ed Hillmann made changes -
        Attachment ICE-3915-1.8.2.patch [ 12034 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19497 Mon Oct 26 11:36:09 MDT 2009 yip.ng ICE-3915: Fixed typo of component type constant.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/inputrichtext/InputRichText.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelpositioned/PanelPositioned.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/effect/ApplyEffect.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelcollapsible/PanelCollapsible.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/gmap/GMap.java
        Ken Fyten made changes -
        Assignee Priority P2
        Assignee Yip Ng [ yip.ng ]
        Hide
        yip.ng added a comment -

        Changes applied to 1.8 trunk.

        Show
        yip.ng added a comment - Changes applied to 1.8 trunk.
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.8.2-EE-Beta [ 10215 ]
        Ken Fyten made changes -
        Fix Version/s 1.8.2-EE-GA [ 10216 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19906 Wed Dec 09 11:26:13 MST 2009 adnan.durrani 1.8.2EE changes(ICE-3915) moved to Compat towards ICE-4481
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/gmap/GMap.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/panelcollapsible/PanelCollapsible.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/panelpositioned/PanelPositioned.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/inputrichtext/InputRichText.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/effect/ApplyEffect.java
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P2
        Assignee Yip Ng [ yip.ng ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Ed Hillmann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: