How to send paramater from .zul to .Java?

asked 2015-12-16 14:32:35 +0800

SolarMax gravatar image SolarMax


I have several .zul page calling different ViewModel. ex :

<window border="none" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('xxx.zzz.page1')"> 

<include src="/include/header.zul" />

. . .

And so on for page2, page3, ...

I would like to use only one viewmodel "page". But I have to transmit one parameter :

public String parameter;

public String getParameter() {
    return parameter;

public void setParameter(String parameter) {
    this.parameter = parameter;

How can i declare this parameter in each .zul? Something like :

@bind(vm.parameter) value="valueForPageX"

Thank you!

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-12-16 15:01:18 +0800

chillworld gravatar image chillworld flag of Belgium
5337 4 9

I don't fully understand your question but I think you mean this :

 viewModel="@id('vm') @init('xxx.zzz.page1', page='page1')">

and in the Viewmodel :

public class InitVM {

    public void init(@BindingParam("page") String page){
        System.out.println("page: "+ page);

Here is the documentation for that.

Greetz Chill.

link publish delete flag offensive edit

answered 2015-12-18 15:13:58 +0800

SolarMax gravatar image SolarMax

It's so obvious ... shame on me!

Thanks a lot!

link publish delete flag offensive edit
Your answer
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




Asked: 2015-12-16 14:32:35 +0800

Seen: 51 times

Last updated: Dec 18 '15

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