answered
2013-07-24 12:39:52 +0800
sjoshi 3493 ● 1 ● 8
http://zkframeworkhint.bl...
When you press the OK Button write logic in that button to open your modal Window and do something like this..
@Command
public void oKButtonPress(@ContextParam(ContextType.VIEW) Component comp) {
Harnesstype harnesstype = //Your Business Logic to get the object
showModalWindow(harnesstype,comp );
}
And here the logic to create Modal Window and pass the Object in same viewModel or Parent ZUL.
public void showModalWindow(Harnesstype harnesstype,Component comp) {
Map<String, String> arguments = new HashMap<String, String>();
arguments.put("harnesstype", harnesstype);
Executions.createComponents("popupwindow.zul", comp, arguments);
}
And now in afterCompose of your PopupModalWindow Java class write this logic..
public void doAfterCompose(@ContextParam(ContextType.VIEW) Component view,
@ExecutionArgParam("harnesstype") Harnesstype myObject) throws Exception {
//Now do what you want to do with Harnesstype object.
}
See this will help you .
And in you zul do this
<window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('com.YourViewModel')" height="50%" width="48%" mode="modal" >
See i added mode="modal"
attribute and deleted from java code
Have a viewmodel for popupwindow.zul, Now in your viewmodel ---> aftercompose method do like:
rest is the same as we do for all zul file.
nsharma ( 2013-07-22 10:27:56 +0800 )edit