zk后台控制类如何调用前端javascript 中的function 方法

zul页面:
<zk>
<script src="">
function aa(b){
alert(b);
b.disabled = "true";
}
</script>
<window use="ExecuteFunction">
    <button id ="btn"/>
</window>
</zk>

控制类:
public class ExecuteFunction extends Window implements AfterCompose {
    public Button btn;
    @Override
    public void afterCompose() {
       // TODO Auto-generated method stub
/*给变量负值*/
Components.wireVariables(this, this);
/*自动发送*/
Components.addForwards(this, this);
    }
    public void onCreate(){
       btn.setAction("onclick:aa(this);");
    }

}

你可能感兴趣的:(JavaScript,zk)