Yep,

allready tried that.... errors on the fact the the specific object doesn't have the requested property.... maybe I'll need to add an additional domain object have ALL the methods and convert the underlying objects on the backingbean...

On 11/24/05, Marius Kreis <[EMAIL PROTECTED]> wrote:
Good point. You could use
<h:outputText value="#{user.address}" rendered="#{ user.class.name eq
"Customer"}">
But I doubt that it works... I think the _expression_ wil be evaluated
first and then throw an exception... sorry.

Peter Maas wrote:
> I understand that this is possible, but how can I test this within a
> tableGrid component without jstl?
>
> On 11/24/05, *Marius Kreis* < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     Hi Peter.
>     Perhaps you can check for the class of the object with
>     user.class.name <http://user.class.name>
>     I think this should query user.getClass().getName() .... and then you
>     can compare it to "User" or "Customer"....
>
>     Peter Maas wrote:
>      > Hi all,
>      >
>      > I'm probably missing something obvious, but how can I 'detect' the
>      > existence of a property on a bean? I have a managed bean return a
>     list
>      > of users, which might can be a plain user or an extended 'customer'
>      >
>      > class User{
>      >   String firstname;
>      >   String lastname;
>      >   String email;
>      >
>      >   // getters and setters
>      > }
>      >
>      > class Customer extends User{
>      >   String address;
>      >   // etc.
>      > }
>      >
>      >
>      > Now if I want to mix those objects in one single dataTable I
>     cannot find
>      > a way to display properties from
>      > customer objects.... the code will break on plain user objects,  and
>      > complains about missing properties.
>      >
>      > I tried using jstl inside the table, but I'm not sure how the 'test'
>      > properties of iterated items in the dataTable...  a simple ${!empty
>      > user.address } doesn't  work.
>      >
>      > Actually, I would prefer to NOT use jstl..... but stick to
>     JSF.... is it
>      > possible with the existing tags?
>      >
>      > regards,
>      >
>      > Peter
>
>


Reply via email to