4 Replies Latest reply on Feb 22, 2010 3:59 PM by Werner Jacobs

    EL question (testing if a object belongs to a class)

    Werner Jacobs Newbie

      I wonder how I should iterate over a list of parent objects(in a class hierarchy) in facelets.

      I have a polymorphic query which returns me a collection of parent objects.

      As I consulted the EL documentation, it does not seem to have a .class operator to verify if an object is of a certain subclass.

      In the page I am showing to the enduser, different columns should be filled in depending of the kind of subclass/class the object belongs to. So I need a way to test if an object belongs to a certain subclass.

      Is this something which should not be done in JSF/facelets?

      Are there workarounds? For the moment I am implementing in each subclass some method which returns me a string telling to which class an object belongs. This seems to me an awkward way of doing things as the information is already within the class hierarchy.

      Thanks for your help