I wasn't very clear in describing what I'm trying to achieve.

The drop down is part of a form, filling a criteria object to perform queries. This criteria object has actually nothing more than a few properties, one of them being a "since" property to query the database for entities having a timestamp greater than "since". All properties are null by default to indicate that the properties is not taken into account for the query. The form now offers the user some predefined possibilities to set the "since". This is "today", "yesterday" and "all". What I see is that I can fill the id of e.g. "today" with the timestamp of today and so the used date converter will work. But actually this is not what I want. I'd rather like to receive e.g. "today" and then convert it to the date I need.

The question for me is why getConverter(..) seems not to be called in the Choice classes but e.g. in TextField.


Am 07.07.2009 um 17:08 schrieb James Carman:

Your DropDownChoice should be a DropDownChoice<Date>. Then, the "things" shown by the DropDownChoice are Date objects. You want to render those dates (one of them is a null) using String values (known as the display value to the renderer). You might have to set up a localized message to get "all" to display for null, though (rather than "Choose One" or whatever).

On Tue, Jul 7, 2009 at 10:55 AM, Christoph Drießen <[email protected]> wrote:

I cannot see how to get the input converted into a Date. The other way round seems clear to me, but how do I get "all" or "today" into a Date with a renderer? Isn't the renderer just for rendering like it's name suggests?
Or am I missing something here?


Am 07.07.2009 um 16:32 schrieb James Carman:


So, why wouldn't a renderer work for you?  You could use a map-based
renderer if you wish.

On Tue, Jul 7, 2009 at 9:16 AM, Christoph Drießen <[email protected]> wrote:

James,

I'm not sure if this approach will solve my problem. This is what I try
to
do:

I'd like to display a drop down with the choices "today", "yesterday" and "all". Depending on the user's selection the model object's property
which
is of type Date shall be filled with either a Date object or null (upon "all" selection). The choice is connected to the model object through a
PropertyModel.

Cheers,
c


Am 07.07.2009 um 14:01 schrieb James Carman:


Try using an IChoiceRenderer rather than a converter.


On Tue, Jul 7, 2009 at 7:45 AM, Christoph Drießen <[email protected]> wrote:

Hi all,


I'm trying to use a Converter with a DropDownChoice overriding the getConverter(Class type) method. Unfortunately this method never gets
called.
Any ideas?

Christoph

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to