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);
    }
  • 相关阅读:
    逝者如斯夫(一)
    C#面向对象-多态
    C#基础知识1-深入理解值类型和引用类型
    一个简单的C#爬虫程序
    C# Web分页功能实现
    Web前端JS实现轮播图原理
    visual studio2019 离线MSDN文档安装
    C#中类的修饰符
    HALCON数据类型和C#对应数据类型的对比
    关于HACLON程序导出C#程序,运行报错解决方法
  • 原文地址:https://www.cnblogs.com/BobXie85/p/11542262.html
Copyright © 2011-2022 走看看