0

How can I retrieve the current desktop and page when browser refresh?

asked 2009-11-25 01:25:33 +0800

likebean gravatar image likebean
39 2

Hi all,I want to use zk in my portal environment to develop portlet,In the portal page,there maybe other portlet not develop using ajax technology,so operation in non-ajax-portlet may result in whole portal page refresh.so how can I keep the component state of the zk-portlet(if there are tree with two node expand in the zk-portlet,keep that after the page refresh..etc..)? because zk has the corresponding desktop ,page and component in the server side,so feel this issue can be resolve,but how?

thanks

best rgds

L.J.W

delete flag offensive retag edit

11 Replies

Sort by ยป oldest newest

answered 2009-11-25 05:14:38 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

I think you should store the data that you want to keep between refresh in session scope and use data binding to populate it. Everytime a refresh happens the data binding will get the data from session into your portlet.

The components of a page in server side are all recreated if the user refresh the page.

Obs.: I never used portlet I'm assuming they behave like other pages/components.

link publish delete flag offensive edit

answered 2009-11-25 19:16:41 +0800

likebean gravatar image likebean
39 2

updated 2009-11-26 00:53:15 +0800

any method not recreate the desktop,page and components when refresh browser,and only retrieve the existed Desktop and Page Object and redraw ?
I am confused about the concept:Desktop and Page,ZK document say Desktop may contain many pages,what 's meaning?any example about one desktop contain many pages?what's relationship about URL,Http Session,Desktop and Page?
When I refresh Browser,I find DHtmlLayoutServlet will create new Desktop and Page and Components each time,old Object seems be discard,I think this will result in many discard objects in the session scope,any issues?

link publish delete flag offensive edit

answered 2009-11-26 12:04:34 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

I Don't understand the first question.

I never found it written but I believe that Desktop is very like as HTTP Session, it can store data and share with it's page, or a better view of the things is that de Desktop is in session scope.

When refresh the page the Desktop is not recreated but the page and it's components are. I don't think this a problem because the generational garbage collector handle very well young objects being discard.

link publish delete flag offensive edit

answered 2009-11-26 21:52:24 +0800

likebean gravatar image likebean
39 2

fmcypriano,thanks for your reply,when refresh the page,the Desktop will be recreated,I have debug zk code,anybody has other advice?please.

link publish delete flag offensive edit

answered 2009-11-27 05:32:05 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi,

You can specify the cache-provider-class, please take a look at - Developer's guide.

link publish delete flag offensive edit

answered 2009-11-28 08:04:43 +0800

likebean gravatar image likebean
39 2

thanks jumper,but my question is :

any method not recreate the desktop,page and components when refresh browser,and only retrieve the existed Desktop and Page Object and redraw ?
I am confused about the concept:Desktop and Page,ZK document say Desktop may contain many pages,what 's meaning?any example about one desktop contain many pages?what's relationship about URL,Http Session,Desktop and Page?
When I refresh Browser,I find DHtmlLayoutServlet will create new Desktop and Page and Components each time,old Object seems be discard,I think this will result in many discard objects in the session scope,any issues?

link publish delete flag offensive edit

answered 2009-11-29 19:40:20 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi,

There is a way to reuse the desktop, but it is not easy to do so.
Please check the org.zkoss.spring.security.config.ZkDesktopReuseFilter and ZkSpringUiFactory from the SVN repository.

link publish delete flag offensive edit

answered 2009-11-29 19:57:38 +0800

likebean gravatar image likebean
39 2

Thanks jumper
Can this feature add in ZK 5.0?because I think serverside executing is the most different and advantage when compare ZK with other ajax-web framework like GWT.If not only using ajax style but also keeping components state when refreshing browser,It's cool,and will be great feature of ZK!

L.J.W

link publish delete flag offensive edit

answered 2009-11-29 21:14:42 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi,

You can post a feature request.

Thanks,

link publish delete flag offensive edit

answered 2009-11-30 08:28:59 +0800

likebean gravatar image likebean
39 2

Hi jumper,has post feature request,wish get a result quickly...Thanks.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-11-25 01:25:33 +0800

Seen: 1,101 times

Last updated: Nov 30 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More