You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by lars vonk <la...@gmail.com> on 2008/08/04 14:40:13 UTC

getter setter strategy for models

Hi,

I realized that when I have a getter, but no setter for a certain
property on a Model object for form components it fails with the
message that it can't find a setter. When I don't have any getters and
setters the binding still works since it uses field access.

I expect this intended behavior, right? If so, what are your thoughts
about changing this that for instance to be able to define a sort of
"property strategy" for binding values to your model object. I would
like to have getters for my model objects, but no setters.

Or am I overlooking something here and is it already possible to
define the "property strategy"?

Regards,

Lars

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


Re: getter setter strategy for models

Posted by lars vonk <la...@gmail.com>.
Thanks for replying,

Making the set method private does not work and results in the same
exception as having no public setter.

Any other thoughts?

On Tue, Aug 5, 2008 at 12:19 AM, Patrick Angeles <pa...@inertiabev.com> wrote:
>
> Have you tried private/default scoped setter methods, and would that be an
> okay compromise for what you want to do?
>
>
> lars vonk wrote:
>>
>> Hi,
>>
>> I realized that when I have a getter, but no setter for a certain
>> property on a Model object for form components it fails with the
>> message that it can't find a setter. When I don't have any getters and
>> setters the binding still works since it uses field access.
>>
>> I expect this intended behavior, right? If so, what are your thoughts
>> about changing this that for instance to be able to define a sort of
>> "property strategy" for binding values to your model object. I would
>> like to have getters for my model objects, but no setters.
>>
>> Or am I overlooking something here and is it already possible to
>> define the "property strategy"?
>>
>> Regards,
>>
>> Lars
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/getter-setter-strategy-for-models-tp18810507p18820993.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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


Re: getter setter strategy for models

Posted by Patrick Angeles <pa...@inertiabev.com>.
Have you tried private/default scoped setter methods, and would that be an
okay compromise for what you want to do?


lars vonk wrote:
> 
> Hi,
> 
> I realized that when I have a getter, but no setter for a certain
> property on a Model object for form components it fails with the
> message that it can't find a setter. When I don't have any getters and
> setters the binding still works since it uses field access.
> 
> I expect this intended behavior, right? If so, what are your thoughts
> about changing this that for instance to be able to define a sort of
> "property strategy" for binding values to your model object. I would
> like to have getters for my model objects, but no setters.
> 
> Or am I overlooking something here and is it already possible to
> define the "property strategy"?
> 
> Regards,
> 
> Lars
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/getter-setter-strategy-for-models-tp18810507p18820993.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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