zoukankan      html  css  js  c++  java
  • 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);
    }
  • 相关阅读:
    JAVA嵌入运行Groovy脚本
    git撤销本地所有未提交的更改
    Java连接S3并上传Redis
    jython笔记
    Elasticsearch 5.2.x 使用 Head 插件连接不上集群
    elasticsearch 5.1 别的机器无法访问9200端口
    elasticsearch,http://ip:9200访问不到的解决办法
    在centos7中安装nodejs(npm )
    java标识符和关键字
    Java平台
  • 原文地址:https://www.cnblogs.com/BobXie85/p/11542262.html
Copyright © 2011-2022 走看看