0

How to open a new Window in Java Class

asked 2009-07-03 08:39:19 +0800

rockywang gravatar image rockywang
78

<window id="loginwin" title="Login Window" border="normal" width="50%"
use="tw.com.twm.ntportal.control.LoginWindow" >

in my "LoginWindow" (my control class)

I know to use Executions.sendRedirect("conference.zul"); to redirect to another page.

But how can I keep my older page , and just open a new window ?

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2009-07-03 09:29:17 +0800

woodyki gravatar image woodyki
168

Use Execution.sendRedirect(java.lang.String uri, java.lang.String target)

Parameters:
uri - the URI to redirect to, or null to reload the same page
target - the name of the browser window that send-redirect will load the sepcified URI, or null if the current browser window is used.

e.g. Excutions.getCurrent().sendRedirect("conference.zul", "New Window")

link publish delete flag offensive edit

answered 2009-07-03 21:30:33 +0800

rockywang gravatar image rockywang
78

thank you for answer , I learn from ZK knowledge from you. :)

But my requirement is that, the "conference.zul" should like popup under the same page.

I had try about win.doPopup, but when my mouse move out the page, and just click, the conference.zul page is disappear !
This is not what I want :(
I wnat the popup window more like a "normal" window.

link publish delete flag offensive edit

answered 2009-07-04 16:42:08 +0800

rockywang gravatar image rockywang
78

Oh, I found that the Firefox and IE behavior is different !

the IE will open new Window, but Firefox open new tab.

link publish delete flag offensive edit

answered 2009-07-05 12:45:22 +0800

caclark gravatar image caclark
1753 2 5
http://clarktrips.intltwi...

did you try Executions.createComponents( file, parent, params ), like this?:


                try
                {
                    win = (Window)Executions.createComponents( filename, null, params ) ;
                    win.addEventListener( "onClose", this ) ;
                    win.setParent( event.getTarget() ) ;
                    win.doOverlapped() ;
                }
                catch(Exception exc)
                {
                    logger.error( "onOpenWindow:: error opening window", exc ) ;
                    error = exc.getMessage() ;
                    if ( win != null )
                    {
                        win.detach() ;
                    }
                }

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-07-03 08:39:19 +0800

Seen: 885 times

Last updated: Jul 05 '09

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