You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Baschir Jaghoori <Ba...@mgm-tp.com> on 2010/09/16 18:38:04 UTC

What happened to the Constructor with propertyType in PropertyModel?

Hi,

I want to output the width and height fields of a java.awt.Dimension
object (which are integers) and tried to use the PropertyModel, but
because PropertyModel calls getWidth() / getHeight() (which return
doubles), the result is displayed as 100.0 instead of 100

It seems, that there was a constructor in PropertyModel for this case,
but it seems to have disappeared - wonder why? And is there any other
"nice" way to convert the double to int - other than to implement my own
model?

PropertyModel(java.lang.Object modelObject, java.lang.String expression,
java.lang.Class propertyType)

Cheers,
Baschir

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: What happened to the Constructor with propertyType in PropertyModel?

Posted by Igor Vaynberg <ig...@gmail.com>.
conversion is done by components not by models. you can override the
converter on your component.

-igor

On Thu, Sep 16, 2010 at 9:38 AM, Baschir Jaghoori
<Ba...@mgm-tp.com> wrote:
> Hi,
>
> I want to output the width and height fields of a java.awt.Dimension
> object (which are integers) and tried to use the PropertyModel, but
> because PropertyModel calls getWidth() / getHeight() (which return
> doubles), the result is displayed as 100.0 instead of 100
>
> It seems, that there was a constructor in PropertyModel for this case,
> but it seems to have disappeared - wonder why? And is there any other
> "nice" way to convert the double to int - other than to implement my own
> model?
>
> PropertyModel(java.lang.Object modelObject, java.lang.String expression,
> java.lang.Class propertyType)
>
> Cheers,
> Baschir
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org