[jboss-user] [JBoss Seam] - s:selectItems and subclasses

MSchmidke do-not-reply at jboss.com
Mon Nov 12 04:00:31 EST 2007


Hello all,

I'm not quite sure whether this is a seam problem or a general JSF problem, but perhaps you can help me.

I have problems getting the right h:selectOneMenu highlighted caused by Hibernate proxy class hierarchie.

I am using a h:selectOneMenu together with s:selectItems and s:convertEntity.

The objects displayed are from a class hierarchie, say, 

abstract class A
class B extends A
class C extends A

, which are EJB3 entities.

The list which is displayed (the selectitems) are some entities of class B or C.

The object which is selected is a lazy loaded reference from some other entity, so that in fact, the displayed object is not an instance of B or C but an instance of Proxy-For-A ("A_$$_javassist_77" or so).

com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption() now tries to determine for every object in the list whether it is selected. To check the selected state, it first tries to coerce the current iterated value to the type of the selected value, i.e. from B to Proxy-For-A, before it does an equals() compare.

Of course, this leads to an exception, which is silently ignored and no object is displayed as selected.

Any ideas??


Marcus.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103574#4103574

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103574



More information about the jboss-user mailing list