• zk不同页面之间的即时刷新


    公共刷新方法

    import org.zkoss.bind.annotation.GlobalCommand;
    import org.zkoss.bind.annotation.NotifyChange;
    
    @GlobalCommand("refreshDeploy")
    @NotifyChange({ "deploy", "imageContent" })
    public void refreshDeploy(@BindingParam("planId") String planId) {
        if (planId != null && !"".equals(planId)) {
            BasicDBObject queryall = new BasicDBObject();
            queryall.put("planId", planId);
            queryall.put("webEnable", true);
            MongoDBBaseExamViewModel mongo = new MongoDBBaseExamViewModel();
            BasicDBObject SystemInfo = mongo.findOne(queryall, "SystemInfo");
            if (SystemInfo != null) {
                getDeploy().put("baoMingWenAn", SystemInfo.getString("baoMingWenAn"));
                getDeploy().put("websiteName", SystemInfo.getString("websiteName"));
                getDeploy().put("organizer", SystemInfo.getString("organizer"));
                getDeploy().put("imageString", SystemInfo.getString("imageString"));
                getDeploy().put("imageType", SystemInfo.getString("imageType"));
                try {
                    String src = getDeploy().getString("imageString");
                    if (src != null && !"".equals(src)) {
                        imageContent = new AImage("photo", ConvertUtil.hexStr2Bytes(src));
                    }
                } catch (IOException e) {
                    imageContent = null;
                }
            }
        }
    }

    触发刷新方法

    import org.zkoss.bind.annotation.AfterCompose;
    import org.zkoss.bind.BindUtils;
    
    @AfterCompose
    public void afterCompose(@ContextParam(ContextType.VIEW) Component view){
        Map map=new HashMap();
        map.put("planId", planId);
        BindUtils.postGlobalCommand(null, null, "refreshDeploy", map);
    }
  • 相关阅读:
    ie6内存泄漏问题的解决
    精简版拖动
    【转】在ASP.Net中写系统日志
    转 集中遍历遍历datatable的方法
    水晶报表字段为空时设置默认值
    数据库一种IN查询
    两种获得路径的测试
    整理——ASP.net UTF8支持
    Subversion svnserve 服务配置 整理
    [转自CSDN] SQL基础> 约束(CONSTRAINT)
  • 原文地址:https://www.cnblogs.com/BobXie85/p/11542262.html
Copyright © 2020-2023  润新知