You're right that would be nice (and expected), but if I call
setObject(...) on the current page in the listener it won't be set when
the page is rendered again. From what I can tell by logging messages in
PageAttachListener and PageDetachListener the page is re-acquired from
the pool before rendering the result, which wipes out any non-persistent
values.
I don't want to persist the result value since I just want it for
rendering the next time and then I want it to go away.
Again, I'm using this in a portlet so I'm not sure if this is an issue
with tapestry in portlets or in general...
-Aj
Schulte Marcus wrote:
The result is exactly what it should be!
Why would you want a separate instance of your page? Just set your
"result-property" in the listener and return nothing from the listener. Then
render the result property in your page-template.
-----Original Message-----
From: Aj Gregory [mailto:[EMAIL PROTECTED]
Sent: Monday, January 30, 2006 7:36 PM
To: Tapestry users
Subject: Re: Rendering form submit response with the same page.
Thanks for the suggestion! I gave it a shot but the result
was the same.
-Aj
Jesse Kuhnert wrote:
What about using IRequestCycle to set the page instead? Ie
public void doSubmit(IRequestCycle cycle) {
cycle.activate(getTestPage()); ?
}
On 1/30/06, Aj Gregory <[EMAIL PROTECTED]> wrote:
I have a page which I want to use to display a form and
some results
after the form is submitted.
After the form listener does some work I want to set a
value on the page
and show the same page again. To do this I created a
listener on the
page class and inject a page of the same type as the
current page and
set the property that I want:
@InjectPage("TestPage")
public abstract TestPage getTestPage();
public abstract Object getObject();
public abstract void setObject(Object o);
public IPage doSubmit() {
TestPage tp = getTestPage();
tp.setObject(...);
return tp;
}
This doesn't work. From what I can tell tapestry doesn't
create a new
instance of the page and instead gets the same instance
that it used to
handle the form submit with all of the values reset. I tried just
calling setObject() on the current instance and returning
"this" but
that doesn't work either.
Any suggestions? I'm doing this within a portlet in case
that matters.
Thanks
-Aj
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]