GenericForwardComposer

参考API:
https://www.zkoss.org/javadoc/latest/zk/

Demo:

A skeletal composer that you can extend and write intuitive onXxx$myid event handler methods with auto event forwarding and "auto-wired" accessible variable objects such as embedded objects, components, and external resolvable variables in a ZK zuml page; this class will add forward condition to the myid source component and forward source onXxx event received by the source myid component to the target onXxx$myid event (as defined in this composer) of the supervised target component; of course it will also registers onXxx$myid events to the supervised component and wire all accessible variable objects to this composer by calling setXxx() method or set xxx field value directly per the variable name.


 MyComposer.java

 public class MyComposer extends GenericForwardComposer {
     private Textbox mytextbox;
     private Window self; //embedded object, the supervised window "mywin"
     private Page page; //the ZK zuml page
     private Label mylabel;

     public void onChange$mytextbox(Event event) {
         mylabel.setValue("You just entered: "+ mytextbox.getValue());
     }
 }

 test.zul

 <window id="mywin" apply="MyComposer">
     <textbox id="mytextbox"/>
     <label id="mylabel"/>
 </window>

主要方法:

doAfterCompose(T comp)
Auto forward events and wire accessible variables of the specified component into a controller Java object; a subclass that override this method should remember to call super.doAfterCompose(comp) or it will not work.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值