-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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.
<button label="submit" popup="dataEntry"></button> <popup id="dataEntry"> <iframe src="dataEntry.zul" /> </popup>
Asked: 2010-07-15 01:10:46 +0800
Seen: 394 times
Last updated: Aug 05 '10