0

Urgent HELP needed: How to open a new browser window which is a new ZK page of my current desktop!

asked 2008-12-07 12:23:14 +0800

hkn gravatar image hkn
246 3

Hello !

I have a list of entries in a listbox an when the user doubleclicks I want to open a new browser window
with a new zul file which belongs to my current desktop. All works fine as long as I do not try to
open a new browser window / new page.

	
public void onDoubleClick$lbForwarded( Event e) {
   MdbUserForwardedWithBLOBs forwarded = (MdbUserForwardedWithBLOBs) lbForwarded.getSelectedItem().getAttribute("data");
   Executions.getCurrent().sendRedirect("newPage.zul","_blank");
}

The new browser window opens, but the created page "newPage" does not belong to the same desktop, so I cannot share data etc.

Kind regards

/Horst

delete flag offensive retag edit

13 Replies

Sort by ยป oldest newest

answered 2008-12-07 18:37:10 +0800

YamilBracho gravatar image YamilBracho
1722 2

I think you can add parameters to your url, say newPage.zul?p1=v1&p2=v2&..pn=vn or use Executions.createComponents method

HTH

link publish delete flag offensive edit

answered 2008-12-08 07:56:32 +0800

hkn gravatar image hkn
246 3

Hello YamilBracho!

that is not the question. For my application it is very important to share the desktop to access state beans etc.
The problem is not to open an independent browser window. I want a new page as a element of the
current desktop opened in a new browser window.
How can Executions.createComponents open a new browser window?? May I do not understand the API....

Horst

link publish delete flag offensive edit

answered 2008-12-08 11:23:02 +0800

dennis gravatar image dennis
3669 1 6
http://www.javaworld.com....

Hi, Horst,
one desktop only belong to one browser/browser tab, a url.
you could not share same deskotp to different tabs/browsers.
can't you use a popup(model) window to instead?
or share the status bean in session, not desktop.

link publish delete flag offensive edit

answered 2008-12-08 17:22:58 +0800

hkn gravatar image hkn
246 3

Hi Dennis,
you confirm my fear. I use popups at the moment and it works fine. But the customer
would prefer to open it in a new browser tab/window. The reason is quite simple. The window
contains some information and sometimes will be printed (later).
In some situations I really wish one ZK Desktop could hold its pages on different browser
tabs or windows.

Kind regards
Horst

link publish delete flag offensive edit

answered 2008-12-09 02:08:51 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Hi Horst,

Maybe you can provide a "print friendly" button in the popup. And when pressed, it will render "similar" page on a separate browser window.

/henri

link publish delete flag offensive edit

answered 2008-12-09 09:02:59 +0800

hkn gravatar image hkn
246 3

Hello Henri!

Yes, I just started to render a simple page to print, i found no other solution.
But it is additional work to be done.

Further I now use getSession().getNativeSession().g|setAttribute() to share data between different browser tabs/windows.

As each of this extra browser tab/window are linked with its own desktop object I have no simple way
to update a page if some data changes for example by posting events, so I have started to implement some polling activities to link different desktops of one native session and queue events from one desktop to the other :-( (M

And the extra desktops implies extra memory allocation on my server, too. Some of my customers use to have a lot of browser tab/windows open the same time so that may have an impact in the future when more users will work with that application.

I am just a user of ZK and I know almost nothing about the zk engines and implementation.
Is it impossible in principal to share a desktop among different browser tabs/windows?

Kind regards
/Horst

link publish delete flag offensive edit

answered 2008-12-10 04:58:33 +0800

dennis gravatar image dennis
3669 1 6
http://www.javaworld.com....

Horst.
You can not share a desktop among different browser/tabs.
Maybe you should to search/read document about 'server push' to synchronize UI with data between desktops.

link publish delete flag offensive edit

answered 2008-12-10 08:42:01 +0800

hkn gravatar image hkn
246 3

Hi Dennis!

Thank you! Yes that is exactly my approach. I store my data to exchange between different desktops belonging to the same native sessions in native sessions attributes. Each Desktops pools periodically if native session data has changed (timestamp) an then I update the pages by server push. My fault was that I took the desktop as what the native session is an I did not really recognize that page is NOT a browser tab/window. To me it was a natural expectation that all browser windows belonging to the same native session share one desktop. Maybe that should be explained in more detail here

My prototype/proof of concept works fine but it requires far more bookkeeping and controlling to build a more general framework.

I still think that this would be a nice ZK feature.

Kind regards
/Horst

link publish delete flag offensive edit

answered 2008-12-11 13:53:34 +0800

dennis gravatar image dennis
3669 1 6
http://www.javaworld.com....

Horst,
Although I think share desktops will break some core assumption, but maybe we will find the solution in the feature.
so, please post it to feature request anyway.

link publish delete flag offensive edit

answered 2008-12-11 14:53:15 +0800

hkn gravatar image hkn
246 3

Hello Dennis,

what is that core assumption you talk about, can you share this with the community?
When I saw the image with the desktop and two pages and read that each page represents one url I associated this with one session, one desktop and two pages as two independent browser tabs.

Kind regrads
Horst

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: 2008-12-07 12:23:14 +0800

Seen: 1,294 times

Last updated: Dec 18 '08

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