Details
- 
        Type:
 Bug
            
         - 
        Status: Closed
 - 
            Priority:
 Major
                
             - 
            Resolution: Fixed
 - 
            Affects Version/s: 1.7.2 SP1
 - 
            Fix Version/s: 1.8.2-EE-Beta, 1.8.2-EE-GA, 1.8.3
 - 
            Component/s: ICE-Components
 - 
            Labels:None
 - 
            Environment:Solaris, Glassfish v2
 
- 
                        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
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
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.