0

ZK MVVM add Command to dynamically created component

asked 2014-05-28 17:56:05 +0800

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

updated 2014-08-20 09:51:59 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

Hi

I am using MVVM, i am creating the component from java file and now i want to call a method in the same java file for on click event as shown here

Button mybutton = new Button();
mybutton.setParent(parentdiv);
mybutton.Addevent("OnClicl","onClickMyButton");


@Command
public void onClickMyButton()
{

}

The above way is possible ?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-08-17 10:19:34 +0800

Darksu gravatar image Darksu
1991 1 4

updated 2014-08-17 10:20:26 +0800

Hello Senthilchettyin,

In the following link, there is a very good example on how to achieve your task:

http://forum.zkoss.org/question/19359/dynamically-create-componentsevent-handler/

You can also check the following link for adding event handlers to a dynamically created toolbar:

http://zkfiddle.org/sample/3al93nr/7-Add-Event-Handlers-to-Dynamically-Created-Toolbar#source-2

Best Regards,

Darksu

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

Follow
1 follower

RSS

Stats

Asked: 2014-05-28 17:56:05 +0800

Seen: 87 times

Last updated: Aug 20 '14

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