En l'instant précis du 19/03/07 03:15, Simon Kitching s'exprimait en ces
termes:
> [EMAIL PROTECTED] wrote:
>> Hi Noah,
>>
>> Why is it hard for the back-end logic to set these defaults when it
>> constructs
>> the unpersisted Reservation instance?  I'm not sure I followed that
>> part, it's
>> something we do all the time in our system.
>
> I guess it depends. In some cases it is the *business object* that
> logically has a default value, in which case it should be that tier
> which implements the defaulting logic.
>
> However I can imagine cases where the default is really not part of
> the business behaviour of that object (eg defaulting "http:" as a
> prefix).
>
> Maybe you could write a custom tag that sets defaults, eg
>   <s:setDefault value="default-value"/>
> which would:
> * get the parent component
> * do nothing if its submittedValue property is set
> * do nothing if getValue() is set
> * set its submittedValue to the value of the default tag
Hey, i didn't think about this :). This seems to me a clean way of doing
this and creating the custom component should not be very long. Thanks
for suggestion.

Reply via email to