0

CustomComponent set custom property

asked 2014-09-30 13:56:29 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

updated 2014-10-06 13:22:36 +0800

i have a custom component like this

public class MyCustomButton extends Button 
{
    private Blocking executeTypeOfBlocking;
    public void setExecuteTypeOfBlocking(final Blocking blocking){this.executeTypeOBlocking=blocking;}
}

lang-addon.xml

<component>
   <extends>button</extends>
   <component-name>blockeablebutton</component-name>
   <component-class>CustomButton</component-class>
</component>

i want something like this.

in the ZUL. i have a method which creates the Blocking object.... like this

private Blocking createMyBlockingMethod(){return new BlockingImpl();}

here is my problem this works

<blockeablebutton onCreate='self.setExecuteTypeOfBlocking(createMyBlockingMethod());'>

i would like to do it directly.. but i dont know how. i have try

<blockeablebutton executeTypeOfBlocking='@{createMyBlockingMethod()}'>

error is not throw but nothing is set.

<blockeablebutton executeTypeOfBlocking='createMyBlockingMethod();'>

treat it as a String and a error comes.

in resume i need something like this..

<blockeablebutton executeTypeOfBlocking=new BlockingImpl(self);>

any help is hugely appreciate.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-10-22 09:54:08 +0800

hawk gravatar image hawk
3225 1 5
http://hawkphoenix.blogsp... ZK Team

You can call setExecuteTypeOfBlocking(createMyBlockingMethod()); in a "onCreate" event listener of your composer.

btw, if you declare the method createMyBlockingMethod() in zscript, it should be public to be invoked.

link publish delete flag offensive edit
0

answered 2014-10-05 18:37:15 +0800

Darksu gravatar image Darksu
1991 1 4

Hello javiut,

I believe you will find the answer to your question at the following url:

http://forum.zkoss.org/question/1175/zul-components-attribute/

Best Regards,

Darksu

link publish delete flag offensive edit

Comments

is your post they only pass String or Integers i need to pass instance of the Blocking Object in this case. i hope you can help me.

javiut ( 2014-10-06 13:19:41 +0800 )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-09-30 13:56:29 +0800

Seen: 21 times

Last updated: Oct 22 '14

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