snap!

----- Original Message ----
From: Filip S. Adamsen <[EMAIL PROTECTED]>
To: Tapestry users <users@tapestry.apache.org>
Sent: Sunday, 18 May, 2008 6:17:09 PM
Subject: Re: Little confused

Hi,

Bleeding edge 5.0.12-SNAPSHOT at the moment. @Property autogenerates 
getters and setters so you can just specify getters and setters yourself 
if you don't have access to @Property in your version of Tapestry.

-Filip

On 2008-05-18 16:33, Manuel Corrales wrote:
> 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]
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Reply via email to