You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Yoav Stern <yo...@betamedia.co.il> on 2014/06/16 10:51:31 UTC

wicket urls - how to change "get" url to instance cached one

I am using wicket in my web application. Assuming I have pages a b c where
I move from A to B using page parameters change something in page B model
using ajax and B to C (without using page params).

problem : The scenario is moving A->B->C while changing page b model and
pressing the back button B<-C cause when page B instance (B1)was generated
I used get parameters , therefore a new page B instance was generated(B2) I
would like to return every time to page B

is there a wicket style solution to this problem ?

thank u for getting this far in my post :).

Re: wicket urls - how to change "get" url to instance cached one

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Jun 16, 2014 at 2:06 PM, Yoav Stern <yo...@betamedia.co.il> wrote:

> Scenario :
> When I
> 1.reach Page B using empty c'tor (B1)
> 2.change it using ajax (where as you have mentioned this page already has
> pageId where the one with the get url didnt !!!)
>

I guess it would be easier if you use some short use case descriptions with
sample urls.
It is hard for me to understand which page is "the one with the get url"

If Page B has Ajax component/behavior then it is a stateful page and must
have a pageId in the url.
Do you by chance use IRequestCycleSettings#ONE_PASS_RENDER or any custom
IRequestMapper that removes the page id from the url ?


> 3.move to page C
> 4.return to page B (the same B1)
>
>
> I want the same behavior in all the application pages,what should I do in
> order to get this behavior ?
>
> I thought about writing a middle page , redirect Page that will attach to
> my page page Id and manually admin it , baaaad idea and will cost me a lot
> !!
> so is there another Idea u can help me with please .
>
> martin thank u for all the help .
>
>
>
>
>
>
> On Mon, Jun 16, 2014 at 2:51 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Once again - please users@ mailing list for this kind of questions!
> >
> > When page B is loaded Wicket stores it in the disk - the key is
> > sessionId+pageId.
> > When you do Ajax calls to page B the sessionId and the pageId do not
> change
> > and Wicket overrides the old entry in the disk with the new one, i.e. the
> > new state of page B (B1) is stored over the initial state (B0).
> > When you go to page C and then go back Wicket will load B1.
> >
> > The above will fail only if B1 instance is not serializable. In this case
> > Wicket will log an error in the server logs and B0 won't be overridden.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> >
> >
> > On Mon, Jun 16, 2014 at 1:37 PM, Yoav Stern <yo...@betamedia.co.il>
> > wrote:
> >
> > > in addition to what i have described
> > > I have Page A which redirect using the next link :
> > >
> > > Link<String> link = new Link<String>(propertyName) {
> > >
> > > private static final long serialVersionUID = 1L;
> > >
> > > @Override
> > > public void onClick() {
> > >  getRequestCycle().setResponsePage(HomePage.class, params);
> > > };
> > > };
> > >
> > >
> > > after this link get submited there is a url
> > >
> > >
> >
> http://localhost:8080/tp-backoffice/?navigateTo=Accounts+List&filterBy=online,true
> > > (this is page B )
> > > where the last (navigateTo=Accounts+List&filterBy=online,true) is sent
> > via
> > > the pageParameters to HomePage(pageParameters).
> > >
> > > now I am changing stuff inside B Model by doing Ajax Call which render
> > one
> > > section in this page (this is a list filter and I want the client to
> use
> > in
> > > his travel to this page) , lets call this page instance B1.
> > >
> > > now I once more click on link similer to the on above and I have
> reached
> > > page C .
> > >
> > > I see page C and want to come back to B1.
> > >
> > > when I use the browser back button I get B2 ,
> HomePage(pageParameters)
> > is
> > > called once again , but I want that even though I used get call I would
> > get
> > > http://localhost:8080/tp-backoffice/?2
> > > where 2 shows that the page i am looking for is instance B1
> > >
> > > what am I doing wrong ?
> > >
> > >
> > >
> > > On Mon, Jun 16, 2014 at 11:57 AM, Martin Grigorov <
> mgrigorov@apache.org>
> > > wrote:
> > >
> > > > http://markmail.org/message/bk5zwpx5w7xdlkoa
> > > >
> > > > please write to users@ for this kind of questions
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > >
> > > >
> > > > On Mon, Jun 16, 2014 at 10:51 AM, Yoav Stern <yoav.s@betamedia.co.il
> >
> > > > wrote:
> > > >
> > > > > I am using wicket in my web application. Assuming I have pages a b
> c
> > > > where
> > > > > I move from A to B using page parameters change something in page B
> > > model
> > > > > using ajax and B to C (without using page params).
> > > > >
> > > > > problem : The scenario is moving A->B->C while changing page b
> model
> > > and
> > > > > pressing the back button B<-C cause when page B instance (B1)was
> > > > generated
> > > > > I used get parameters , therefore a new page B instance was
> > > > generated(B2) I
> > > > > would like to return every time to page B
> > > > >
> > > > > is there a wicket style solution to this problem ?
> > > > >
> > > > > thank u for getting this far in my post :).
> > > > >
> > > >
> > >
> >
>

Re: wicket urls - how to change "get" url to instance cached one

Posted by Yoav Stern <yo...@betamedia.co.il>.
Scenario :
When I
1.reach Page B using empty c'tor (B1)
2.change it using ajax (where as you have mentioned this page already has
pageId where the one with the get url didnt !!!)
3.move to page C
4.return to page B (the same B1)


I want the same behavior in all the application pages,what should I do in
order to get this behavior ?

I thought about writing a middle page , redirect Page that will attach to
my page page Id and manually admin it , baaaad idea and will cost me a lot
!!
so is there another Idea u can help me with please .

martin thank u for all the help .






On Mon, Jun 16, 2014 at 2:51 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Once again - please users@ mailing list for this kind of questions!
>
> When page B is loaded Wicket stores it in the disk - the key is
> sessionId+pageId.
> When you do Ajax calls to page B the sessionId and the pageId do not change
> and Wicket overrides the old entry in the disk with the new one, i.e. the
> new state of page B (B1) is stored over the initial state (B0).
> When you go to page C and then go back Wicket will load B1.
>
> The above will fail only if B1 instance is not serializable. In this case
> Wicket will log an error in the server logs and B0 won't be overridden.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Mon, Jun 16, 2014 at 1:37 PM, Yoav Stern <yo...@betamedia.co.il>
> wrote:
>
> > in addition to what i have described
> > I have Page A which redirect using the next link :
> >
> > Link<String> link = new Link<String>(propertyName) {
> >
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > public void onClick() {
> >  getRequestCycle().setResponsePage(HomePage.class, params);
> > };
> > };
> >
> >
> > after this link get submited there is a url
> >
> >
> http://localhost:8080/tp-backoffice/?navigateTo=Accounts+List&filterBy=online,true
> > (this is page B )
> > where the last (navigateTo=Accounts+List&filterBy=online,true) is sent
> via
> > the pageParameters to HomePage(pageParameters).
> >
> > now I am changing stuff inside B Model by doing Ajax Call which render
> one
> > section in this page (this is a list filter and I want the client to use
> in
> > his travel to this page) , lets call this page instance B1.
> >
> > now I once more click on link similer to the on above and I have reached
> > page C .
> >
> > I see page C and want to come back to B1.
> >
> > when I use the browser back button I get B2 ,   HomePage(pageParameters)
> is
> > called once again , but I want that even though I used get call I would
> get
> > http://localhost:8080/tp-backoffice/?2
> > where 2 shows that the page i am looking for is instance B1
> >
> > what am I doing wrong ?
> >
> >
> >
> > On Mon, Jun 16, 2014 at 11:57 AM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> > > http://markmail.org/message/bk5zwpx5w7xdlkoa
> > >
> > > please write to users@ for this kind of questions
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > >
> > >
> > > On Mon, Jun 16, 2014 at 10:51 AM, Yoav Stern <yo...@betamedia.co.il>
> > > wrote:
> > >
> > > > I am using wicket in my web application. Assuming I have pages a b c
> > > where
> > > > I move from A to B using page parameters change something in page B
> > model
> > > > using ajax and B to C (without using page params).
> > > >
> > > > problem : The scenario is moving A->B->C while changing page b model
> > and
> > > > pressing the back button B<-C cause when page B instance (B1)was
> > > generated
> > > > I used get parameters , therefore a new page B instance was
> > > generated(B2) I
> > > > would like to return every time to page B
> > > >
> > > > is there a wicket style solution to this problem ?
> > > >
> > > > thank u for getting this far in my post :).
> > > >
> > >
> >
>

Re: wicket urls - how to change "get" url to instance cached one

Posted by Martin Grigorov <mg...@apache.org>.
Once again - please users@ mailing list for this kind of questions!

When page B is loaded Wicket stores it in the disk - the key is
sessionId+pageId.
When you do Ajax calls to page B the sessionId and the pageId do not change
and Wicket overrides the old entry in the disk with the new one, i.e. the
new state of page B (B1) is stored over the initial state (B0).
When you go to page C and then go back Wicket will load B1.

The above will fail only if B1 instance is not serializable. In this case
Wicket will log an error in the server logs and B0 won't be overridden.

Martin Grigorov
Wicket Training and Consulting


On Mon, Jun 16, 2014 at 1:37 PM, Yoav Stern <yo...@betamedia.co.il> wrote:

> in addition to what i have described
> I have Page A which redirect using the next link :
>
> Link<String> link = new Link<String>(propertyName) {
>
> private static final long serialVersionUID = 1L;
>
> @Override
> public void onClick() {
>  getRequestCycle().setResponsePage(HomePage.class, params);
> };
> };
>
>
> after this link get submited there is a url
>
> http://localhost:8080/tp-backoffice/?navigateTo=Accounts+List&filterBy=online,true
> (this is page B )
> where the last (navigateTo=Accounts+List&filterBy=online,true) is sent via
> the pageParameters to HomePage(pageParameters).
>
> now I am changing stuff inside B Model by doing Ajax Call which render one
> section in this page (this is a list filter and I want the client to use in
> his travel to this page) , lets call this page instance B1.
>
> now I once more click on link similer to the on above and I have reached
> page C .
>
> I see page C and want to come back to B1.
>
> when I use the browser back button I get B2 ,   HomePage(pageParameters) is
> called once again , but I want that even though I used get call I would get
> http://localhost:8080/tp-backoffice/?2
> where 2 shows that the page i am looking for is instance B1
>
> what am I doing wrong ?
>
>
>
> On Mon, Jun 16, 2014 at 11:57 AM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > http://markmail.org/message/bk5zwpx5w7xdlkoa
> >
> > please write to users@ for this kind of questions
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> >
> >
> > On Mon, Jun 16, 2014 at 10:51 AM, Yoav Stern <yo...@betamedia.co.il>
> > wrote:
> >
> > > I am using wicket in my web application. Assuming I have pages a b c
> > where
> > > I move from A to B using page parameters change something in page B
> model
> > > using ajax and B to C (without using page params).
> > >
> > > problem : The scenario is moving A->B->C while changing page b model
> and
> > > pressing the back button B<-C cause when page B instance (B1)was
> > generated
> > > I used get parameters , therefore a new page B instance was
> > generated(B2) I
> > > would like to return every time to page B
> > >
> > > is there a wicket style solution to this problem ?
> > >
> > > thank u for getting this far in my post :).
> > >
> >
>

Fwd: wicket urls - how to change "get" url to instance cached one

Posted by Yoav Stern <yo...@betamedia.co.il>.
in addition to what i have described
I have Page A which redirect using the next link :

Link<String> link = new Link<String>(propertyName) {

private static final long serialVersionUID = 1L;

@Override
public void onClick() {
 getRequestCycle().setResponsePage(HomePage.class, params);
};
};


after this link get submited there is a url
http://localhost:8080/tp-backoffice/?navigateTo=Accounts+List&filterBy=online,true
(this is page B )
where the last (navigateTo=Accounts+List&filterBy=online,true) is sent via
the pageParameters to HomePage(pageParameters).

now I am changing stuff inside B Model by doing Ajax Call which render one
section in this page (this is a list filter and I want the client to use in
his travel to this page) , lets call this page instance B1.

now I once more click on link similer to the on above and I have reached
page C .

I see page C and want to come back to B1.

when I use the browser back button I get B2 ,   HomePage(pageParameters) is
called once again , but I want that even though I used get call I would get
http://localhost:8080/tp-backoffice/?2
where 2 shows that the page i am looking for is instance B1

what am I doing wrong ?



On Mon, Jun 16, 2014 at 11:57 AM, Martin Grigorov <mg...@apache.org>
wrote:

> http://markmail.org/message/bk5zwpx5w7xdlkoa
>
> please write to users@ for this kind of questions
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Mon, Jun 16, 2014 at 10:51 AM, Yoav Stern <yo...@betamedia.co.il>
> wrote:
>
> > I am using wicket in my web application. Assuming I have pages a b c
> where
> > I move from A to B using page parameters change something in page B model
> > using ajax and B to C (without using page params).
> >
> > problem : The scenario is moving A->B->C while changing page b model and
> > pressing the back button B<-C cause when page B instance (B1)was
> generated
> > I used get parameters , therefore a new page B instance was
> generated(B2) I
> > would like to return every time to page B
> >
> > is there a wicket style solution to this problem ?
> >
> > thank u for getting this far in my post :).
> >
>

Re: wicket urls - how to change "get" url to instance cached one

Posted by Martin Grigorov <mg...@apache.org>.
http://markmail.org/message/bk5zwpx5w7xdlkoa

please write to users@ for this kind of questions

Martin Grigorov
Wicket Training and Consulting


On Mon, Jun 16, 2014 at 10:51 AM, Yoav Stern <yo...@betamedia.co.il> wrote:

> I am using wicket in my web application. Assuming I have pages a b c where
> I move from A to B using page parameters change something in page B model
> using ajax and B to C (without using page params).
>
> problem : The scenario is moving A->B->C while changing page b model and
> pressing the back button B<-C cause when page B instance (B1)was generated
> I used get parameters , therefore a new page B instance was generated(B2) I
> would like to return every time to page B
>
> is there a wicket style solution to this problem ?
>
> thank u for getting this far in my post :).
>