zoukankan      html  css  js  c++  java
  • zk框架window之间传值操作

    .zul中向Action传递参数:

     <listcell>
                <button label="修改" onClick="@command('edit',id=each.accountId)" autodisable="self" />
                <button label="删除" onClick="@command('delete',id=each.accountId)" />            
              </listcell>
    

     Action中接收参数并且打开新的window

    @Command
        // 接收参数 .zul中的 @BindingParam("id") String accountId
        public void edit(@BindingParam("id") String accountId) {
            Map<String, String> arg = new HashMap<String, String>();
            arg.put("editFlag", "edit");
            arg.put("accountId", accountId);
            // 传递值
            arg.put("flag", "1");
            // 新创建一个组件,并且传值 map
            Window win = (Window) Executions.getCurrent().createComponents("/person/personEdit.zul", null, arg);
            // 设置关闭按钮
            win.setClosable(true);
            // modal:modal与hightlighted模式基本上是相同的。modal模式下,Window之外的组件是不能够操作的(如下图)。
            win.doModal();
        }


    接收来自上一个window的参数

        public AccountVo getEntity() {
            if (entity == null) {
                String flag = (String) Executions.getCurrent().getArg().get("editFlag");
                if (flag.equals("add")) {
                    entity = new AccountVo();
                } else {
                    /*
                     * 接收来自上一个window的参数
                     */
                    String personId = (String) Executions.getCurrent().getArg().get("accountId");
                    entity = personService.findById(personId);
                }
            }
            return entity;
        }
  • 相关阅读:
    VNC跨平台远程桌面的安装与使用
    Apache 的编译安装
    Xming配置
    工作杂记
    自动创建系统用户脚本
    关于linux网络基础记录
    Linux的setup命令启动服务名称和功能
    涉密计算机检查工具
    Nginx压力测试工具之WebBench
    关于系统性能检测的一些使用
  • 原文地址:https://www.cnblogs.com/minotmin/p/3688429.html
Copyright © 2011-2022 走看看