myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Byrne" <den...@dbyrne.net>
Subject Re: MyFaces API SelectItem as an interface rather than a concrete class?
Date Tue, 28 Mar 2006 03:01:32 GMT
Anything under javax.faces is put there per the spec. MyFaces, as an implementation of the
spec, cannot make SelectItem an interface.  

Try using the Decorator patern ;)

Dennis Byrne

>-----Original Message-----
>From: Murray Brandon [mailto:murray@hotmagna.com]
>Sent: Monday, March 27, 2006 10:25 PM
>To: ''MyFaces Official List''
>Subject: MyFaces API SelectItem as an interface rather than a concrete class?
>
>I noticed that javax.faces.model.SelectItem in the MyFaces API is a
>concrete class, which means if I want to make my model objects
>selectable, I have to extend this class - too bad if I already extend
>some other class :-(
>SelectItem appears to lend itself well to being an interface (could move
>the default implementation into a DefaultSelectItem class)?
>Have I missed something?
>
>Regards, Murray
>
>java.lang.ClassCastException: com.playpen.ncs.aui.model.Mob
>	at
>oracle.adfinternal.view.faces.renderkit.uix.SelectItemSupport.addSelectI
>tems(SelectItemSupport.java:280)
>	at
>oracle.adfinternal.view.faces.renderkit.uix.SelectManyShuttleRenderer._g
>etSelectItems(SelectManyShuttleRenderer.java:178)
>	at
>oracle.adfinternal.view.faces.renderkit.uix.SelectManyShuttleRenderer.en
>codeBegin(SelectManyShuttleRenderer.java:60)
>	at
>oracle.adf.view.faces.component.UIXComponentBase.encodeBegin(UIXComponen
>tBase.java:593)
>	at
>org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(Rende
>rerUtils.java:433)
>	at
>org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.rende
>rChildren(HtmlGridRendererBase.java:216)
>	at
>org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encod
>eEnd(HtmlGridRendererBase.java:98)
>
>>From SelectItemSupport in ADF faces:
>
>items.add((SelectItem)iter.next());
>
>



Mime
View raw message