1) So, what does the fact that it creates a new pagemap (or not) has to
do with the current page been expired or not? I mean, I understand the
URL encode for the page versioning stuff, but I don't get why the page
is not expired. Maybe because when I hit the back button, the URL points
to the last created page on the pagemap instead of pointing to an old one?
2) Let me see if I get it right. A page that changes it's component tree
is stateful (like the guestbook example) and one that only changes it's
content through it's models is stateless. Am I right? In that case, why
shouldn't I think a feedback panel as a stateless component (and thus
stateless the page which contains it)?
3) That didn't work for me... I'll give it another try.
Pedro Santos escribió:
1) Why setting bookmarkable or not bookmarkable response page makes the
difference between expiring and not expiring the current page?
Basically, the page instances are versioned to framework be able to get them
back. The default versioning implementation encode page version information
at url. As bookmarkable pages don't have such information encoded on they
ulr, just a new pagemap are created for they.
2) What determines if a page is stateless or stateful? Is it just the fact
that it contains stateless or stateful forms?
It is stateless by default. Contain an statefull component (as form) is
enough to page turn to statefull
3) Is there a way I can expire the current page if I set a bookmarkable
response page?
yes, just: (if I understand your question)
getPageMap().clear();
setResponsePage(MyStatelessPage);
so
1- go to stateless page 1
2 - go to statefull page 2
3 - clean the pagemap go to stateless page 1
4 - click at back button and the page is expired...
If anyone can point us where to read on these subjects we'll appreciate it
very much.
http://cwiki.apache.org/WICKET/page-maps.html
On Wed, Oct 28, 2009 at 1:43 PM, Tomás Rossi <[email protected]> wrote:
Ok... Our page had a StatelessForm inside. We changed it to just Form.
When the form was submitted, we had a bookmarkable page as a response page
and now we changed the call to produce a non-bookmarkable page. This is:
onSubmit() {
...
//setResponsePage(MyResponsePage.class); // <- REMOVED
setResponsePage(new MyResponsePage()); // <- ADDED
...
}
With this (and no need to clear the pagemap) a submit after a back button
produces a page expired message.
If I make the form stateless again, kaboom!
Questions:
1) Why setting bookmarkable or not bookmarkable response page makes the
difference between expiring and not expiring the current page?
2) What determines if a page is stateless or stateful? Is it just the fact
that it contains stateless or stateful forms?
3) Is there a way I can expire the current page if I set a bookmarkable
response page?
We feel Wicket is a great framework, but there are things we don't yet
understand. Mainly, we get really confused on how does Wicket handle back
button, what are and what distinguishes stateless or stateful pages, what
are versioned pages/components, what problems they solve and how to use
them. If anyone can point us where to read on these subjects we'll
appreciate it very much.
Kind regards and thanks,
Tom;
Pedro Santos escribió:
You are aware that to an page expire, it has to be statefull, right?
In a statefull page:
getPage().getPageMap().clear()
and the previous versions will to be removed from pagemap, then you got
the
page expired when try to back to then...
On Tue, Oct 27, 2009 at 4:05 PM, Tomás Rossi <[email protected]> wrote:
Nothing seems to work.
Does the fact that the page I want to expire is the home page has
anything
to do with it?
Pedro Santos escribió:
The page returned from back button came from pagemap. Make sure to
remove
it
from there and you get the expired exception.
On Tue, Oct 27, 2009 at 11:57 AM, Tomás Rossi <[email protected]>
wrote:
Hi, I have another question...
in Wicket (1.4.2), can I force the expiration of a page?
Specifically, if users hit browser's back-button, I'd like to show them
the
page-expired message.
I've already tried to invalidate the session, but I got a horrible
exception when re-submitting the form after reaching it through the
back
button.
Thanks in advance,
--
Tom;
---------------------------------------------------------------------
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]