@Property is certainly in 5.0.11, you can also achieve the same effect with 
standard getters and setters - in fact this is probably a better idea because 
it makes it easier to test your pages IMHO

Toby

----- Original Message ----
From: Manuel Corrales <[EMAIL PROTECTED]>
To: Tapestry users <users@tapestry.apache.org>
Sent: Sunday, 18 May, 2008 3:33:58 PM
Subject: Re: Little confused

Hi Filip, i have no @Property annotation on my Tapestry version. What
version are you using?

On Sat, May 17, 2008 at 7:55 PM, Filip S. Adamsen <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I've found the following pattern to work very well - at least I use it
> everywhere on several sites in production with no problems. :)
>
>  @Property
>  private Item item;
>
>  // I have a form in my template with t:id="add"
>  void onPrepareFromAdd() {
>    if (null == item) item = new Item();
>  }
>
>  void onSuccessFromAdd() {
>    // go about my business with the item
>    ...
>    // I'd normally return here, but since you need
>    // something done in onSubmit...
>  }
>
>  Object onSubmitFromAdd() {
>    // do what you need to do
>    return ...;
>  }
>
> I sometimes persist the item if needed.
>
> Hope this helps.
>
> -Filip
>
>
> On 2008-05-17 16:01, Manuel Corrales wrote:
>
>> Hi, here is my problem. I have a bean on my java page, but i am not using
>> the beaneditorform component to create a new one. Acording to Alexander
>> book, the beaneditorform component can handle the initialization of the
>> bean, so you dont have to create one. As i am not using this component,
>> should i define the bean with a sentence like this:
>>
>> private Matafuego matafuego = new Matafuego();
>>
>> or should i create the new instance on the onActivate method?
>>
>> I tryied the first approach, but the bean is always the same (i guess
>> because of the page pooling mechanism). What is the right approach to
>> this?
>>
>> Thanks very much.
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Reply via email to