asked 2015-06-15 16:00:59 +0800

tess gravatar image tess
5 2

(portion of code is below) My add button is from my zul file; I want to set an action for newButton that is created after add button is clicked.How would I do that in java?

Also, how would I use that newButton I created in java and pass it as parameter to my zul file, so I can set an action for newButton in zul?


    public void add() {

    Tab newTab = new Tab();

    Tabpanel newPanel = new Tabpanel();
    Button newButton = new Button();



Thanks in advance

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2015-06-15 17:28:32 +0800

Darksu gravatar image Darksu
1991 1 4

Hello tess,

For the first question you have to add a event listener to the newly created button as shown at the following fiddle:


But make sure that you will not have any unique id space exceptions. For more info please refer to the following:


Also please refer to the following document that will help understand better component based UI.

Best Regards,


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

1 follower



Asked: 2015-06-15 16:00:59 +0800

Seen: 10 times

Last updated: Jun 15 '15

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