0

How can I open zul file from java class

asked 2013-06-10 19:14:54 +0800

pallagadda gravatar image pallagadda flag of India
1 1

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

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2013-06-11 06:53:42 +0800

JustinFrost gravatar image JustinFrost
145 1 6

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();
}
link publish delete flag offensive edit

answered 2013-06-18 06:46:17 +0800

nsharma gravatar image nsharma flag of India
917 1 11

updated 2013-06-18 06:46:53 +0800

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);
}
link publish delete flag offensive edit

answered 2013-06-18 07:05:26 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

Some examples here

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
3 followers

RSS

Stats

Asked: 2013-06-10 19:14:54 +0800

Seen: 78 times

Last updated: Jun 18 '13

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