2008/5/11 Maurice Marrink <[EMAIL PROTECTED]>:
> On Sun, May 11, 2008 at 12:54 AM, smallufo <[EMAIL PROTECTED]> wrote:
> > 2008/5/11 Maurice Marrink <[EMAIL PROTECTED]>:
> >
> >
> > > PropertyModel is aware of the IModel you are passing and unwraps it.
> > > So depending on what is inside your model you have different options:
> > > -the model contains an object x which has a city property:
> > > make sure x has a getter and setter for city this will be used by the
> > > propertymodel
> > > -the model contains a city object:
> > > do not use a propertymodel at all or use "" as the expression.
> > >
> >
> > This (second) is my situation.
> > This is my custom model object extends Model , which has getCity() ,
> > setCity(...) methods.
> > If I don't use PropertyModel , what should I do ?
>
> Ok so your model contains a city object. You can delete the
> get/setCity methods on the model wicket code will not use them.
> The get/setObject methods are used instead. You could even use the
> default Model if your custom model does not do anything else.
> And then do: new CityDropDownChoice("city" , model,
> Arrays.asList(Cities.values()));
> There is no need for a propertymodel there, since you are interested
> in replacing the entire object.
>
>
Well , it is in fact a my custom MyModel extends Model ,
besides getCity() , setCity(...) , there are still other getter/setters out
there.
That's why I wrote PropertyModel(model , "city") there.