Re: Little confused

2008-05-19 Thread Peter Stavrinides
to the same page. - Original Message - From: Manuel Corrales [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Sunday, 18 May, 2008 5:33:58 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Little confused Hi Filip, i have no @Property annotation on my Tapestry

Re: Little confused

2008-05-18 Thread Manuel Corrales
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

Re: Little confused

2008-05-18 Thread Filip S. Adamsen
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

Re: Little confused

2008-05-18 Thread Toby Hobson
@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

Re: Little confused

2008-05-18 Thread Toby Hobson
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

Re: Little confused

2008-05-17 Thread Kevin Menard
I would probably use a lazy getter with a @Persist attached to the field. Something like: @Persist private Matafuego matafuego; public Metafuego getMetafuego() { if (null == metafuego) { metafuego = new Metafuego(); } return metafuego; } The page instance is guaranteed to

Re: Little confused

2008-05-17 Thread Manuel Corrales
Thanks for your answer, but i still have the same issue. Maybe i am not explaining the problem ok. I have a page with a link, when i press the link the application goes to the new Matafuego page, where i am using a hand made form (i mean not using beaneditorform tag). The first time i do this,

Re: Little confused

2008-05-17 Thread Ned Jackson Lovely
Set your private variable to null in your onSuccess function. On 5/17/08, Manuel Corrales [EMAIL PROTECTED] wrote: Thanks for your answer, but i still have the same issue. Maybe i am not explaining the problem ok. I have a page with a link, when i press the link the application goes to the new

Re: Little confused

2008-05-17 Thread Manuel Corrales
Hi Ned, the onSuccess methos is executed before the onSubmit, so that would not work for me because i am doing the model logic on the onSubmit. I tryed setting my variable in null after executing my businnes logic, but i still have the same issue. My private variable should not be cleaned by

Re: Little confused

2008-05-17 Thread Kevin Menard
It doesn't really matter where you clear it. Just clear it when you're done with it. As for the lifecycle question, you have to clear it because you @Persisted it. If you didn't @Persist it, you wouldn't have to clear it, but you'd likely lose your data when working with the form, depending on

Re: Little confused

2008-05-17 Thread Manuel Corrales
Ok, thanks. Probably this is some stupid begginer mistake, but i cant make this work. My class is this: public class NuevoMatafuego { private Matafuego matafuego = new Matafuego(); @Inject private Messages messages; @Component private Form nuevoMatafuegoForm;

Re: Little confused

2008-05-17 Thread Manuel Corrales
Sorry, my mistake. The same code i posted but without initializing the matafuego variable is working now. I still dont completely understand why tapestry is not cleaning my matafuego variable. Thanks very much for your help! On Sat, May 17, 2008 at 2:39 PM, Manuel Corrales [EMAIL PROTECTED]

Re: Little confused

2008-05-17 Thread Manuel Corrales
Ok, me bothering again. Now when i have a validation error that was checked on the server side, the form is completely wiped out. Thats the normal behavior? On Sat, May 17, 2008 at 2:49 PM, Manuel Corrales [EMAIL PROTECTED] wrote: Sorry, my mistake. The same code i posted but without

Re: Little confused

2008-05-17 Thread Manuel Corrales
Well, i think i am really screwing thnigs up. Very sorry for abusing of your time, i have almost everything working ok. Thanks for your time! On Sat, May 17, 2008 at 2:57 PM, Manuel Corrales [EMAIL PROTECTED] wrote: Ok, me bothering again. Now when i have a validation error that was checked on

Re: Little confused

2008-05-17 Thread Filip S. Adamsen
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(); }