0

zk popup window??

asked 2010-07-15 01:10:46 +0800

sarszk gravatar image sarszk
102 1 3

Hello All,
I need help, I want to create form window popup. Suppose I have 2 zul page.
1st page is view.zul

<zk>
<grid fixedLayout="true" width="600px">
<columns>
<column label="Name"/>
<column label="Address"/>
</columns>
<rows>
<row/>
<row/>
</rows>
</grid>
<button label="Add data" popup="dataEntry.zul"/>
</zk>

2nd zul is dataEntry.zul
<zk>
<window sizable="true" draggable="true" position="center,center">
<grid fixedLayout="false">
<columns>
<column label="Name" width="250px" />
<column label="Address" width="10px" />
</columns>
<rows>
<row zclass="gridonlist">
<label value="Name" />
<label value=":" />
<textbox />
</row>
<row zclass="gridonlist">
<label value="Address" />
<label value=":" />
<textbox />
</row>
</rows>
</grid>
<button label="Submit" onClick="view.zul"/>
</window>
</zk>

but it doesn't work, I don't know how to make it work. Please, give me some way.
Thanks

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-07-15 05:44:24 +0800

daykinr gravatar image daykinr
21 1

If you're trying to bring up view.zul as a separate dialog, make it into a window. The easiest way to bring up a second window is to including both in the one zul file, with the second window set to 'visible=false' by default. Then the onClick on the first window will reference the second window by its id and call 'setVisible(true)' on it. The second window should have a ' mode="overlapped"' attribute. It could also be set to be smaller than the initial window (e.g. width="50%").

If you have a controller class associated with your window, your onClick could call a method on the controller which will bring up the second zul. The controller code is as follows:

Window window = (Window)Executions.getCurrent().createComponents("view.zul", null, getCreationArgsMap());
window.setClosable(true);
window.setMaximizable(false);
window.doModal();

'getCreationArgsMap()' will contain any arguments you wish to pass to the second window. If you don't need it, pass null.

link publish delete flag offensive edit

answered 2010-07-15 06:33:34 +0800

rafaelmaas gravatar image rafaelmaas
51

<button label="submit" popup="dataEntry"></button>

<popup id="dataEntry">
<iframe src="dataEntry.zul" />
</popup>

link publish delete flag offensive edit

answered 2010-08-05 09:24:14 +0800

racagni gravatar image racagni
3

Hi budy, How do you close the popup after you open it and give back to the window that call?

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: 2010-07-15 01:10:46 +0800

Seen: 394 times

Last updated: Aug 05 '10

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