You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2009/10/02 11:39:05 UTC

Fwd: POJO objects in ListView

---------- Forwarded message ----------
From: Sandro Martini <sa...@gmail.com>
Date: 2009/10/2
Subject: Re: POJO objects in ListView
To: pivot-user@incubator.apache.org


Hi Vicente,

> Actually I think my question is irrelevant, ListView calls toString. Sorry to bother
I don't think this is irrelevant, and no problem, questions are always welcome.

In my applications usually I use the toString() for debugging
purposes, and not for business (in this case presentation). Because
with that approach I couldn't have a single bean showing many other
informations in many cases (the toString is an universal method).

So what do you think on add a property (callable from wtk files) where
we choose the bean property name (translated via reflection to the
right getter call) ?
And this could be useful also for many other components, for example
in tables, trees, etc.
And last, attention on inserting null values ... could be useful an
event for this, so application could see what to do, or leave the
component work as its defaults.


I used this approach some time ago form JSP pages, calling getters from beans.
Note that with this approach i could call a custom getter (to expose
the value in a custom format, for example), where the filed is not
existing but exist only the custom getter, sample:
POJO:

String name + public String getName()

but also public String getNameFormatted() that internally uses the
name property and does some other stuff,
and for example public Integer getNameHash(), etc ...



I'd like to discuss this feature also with others ... probably some of
these features are already in Pivot.

Bye,
Sandro