-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.
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.
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
Asked: 2014-09-30 13:56:29 +0800
Seen: 21 times
Last updated: Oct 22 '14