>
> BeanEditor (used internally for BeanEditForm) uses the no-args constructor
> if it exists. I apologize for not making this distinction clear.
>

I'm looking at the 5.2 source and BeanEditor uses the BeanModel to get
the instance, calls "newInstance()" which also uses the
ObjectLocator.autobuild

On Tue, Oct 5, 2010 at 8:32 AM, Thiago H. de Paula Figueiredo
<thiag...@gmail.com> wrote:
> On Tue, 05 Oct 2010 12:17:46 -0300, Michal Gruca <michalgr...@gmail.com>
> wrote:
>
>> I must disagree.
>> But first to clarify. I described two cases.
>> 1. BeanEditForm that cannot instantiate my object
>
> BeanEditor (used internally for BeanEditForm) uses the no-args constructor
> if it exists. I apologize for not making this distinction clear.
>
>> 2. Same issue for SSO creating java.util.Date
>
> ApplicationStateManager(Impl) uses ObjectLocator.autobuild() to construct
> instances.
>
>> Ad 2.
>> Quote from linked documentation:
>> "The first time you access an SSO, it is created automatically. Typically,
>> the SSO will have a public no-args constructor ... but you may inject
>> dependencies into the SSO via its constructor, as you can with a Tapestry
>> IoC service implementation."
>> In this case I wanted to use Date. Maybe not some real case scenario, so
>> let's think about shoping basket for example. It may have default no args
>> for T5 and second one if I want to instantiate it with some products. If
>> T5 always takes constructor with most arguments it will fail on that
>> scenario
>> also, meaning that I will have to check boolean variable companion exist
>> on every page on which I wan't to use my object.
>
> In this case, use @SessionState(create = false) so the field is null when
> it's not in the session. and you don't need to declare a boolean variable.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to