-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi My requirement is when user click on particular cell in spreadsheet I want to open zul file(popup window).But I am unable to do this using Events.ONCELLCLICK. Please let me know what I need to write in java method to open popup(zul window). Thanks in advance
In your controller use something like the following:
@Listen("onClick = #buttonId")
public void openWindow(){
//create a window
Window window = (Window)Executions.createComponents("/path/to/zulFile.zul", null, null);
window.doPopup();
}
If u are using MVC model,u have to use the same way as frost suggests, the other ways is ,you can use
<window mold="modal" ...></window>
in the Zul file you want to call,so the code in your model becomes:
Map args = new HashMap();
args.put("mapkey", variable);
Executions.createComponents("/path/to/zulFile.zul", parentview, args);
arguments are variables you want to send to the model of the ZUL called,as parameters, In model you have to use :
@aftercompose
public void doAfterCompose(@ExecutionArgParam("mapKey") variable_type variable_name ){}
If You are using MVVM model:
In your ZUl in spreadsheet component use :
onClick="@command('onClickSpreadSheet')"
then in your viewModel write a method with same name "onClickSpreadSheet" :
@command
public void onClickSpreadSheet(){
Map args = new HashMap();
args.put("mapkey", variable);
Executions.createComponents("/path/to/zulFile.zul", parentView, args);
}
Some examples here
Asked: 2013-06-10 19:14:54 +0800
Seen: 78 times
Last updated: Jun 18 '13