zk中的Path.getComponent()获取null

时间:2017-07-11 13:56:15

标签: spreadsheet zk zul

当我选择并单击“新按钮”时,我试图打开一个空白电子表格。下面是我的代码

JSP

<div id="header" data-dojo-type="dijit/MenuBar"
        data-dojo-props="region:'top'">
        <div data-dojo-type="dijit/PopupMenuBarItem" id="project">
            <span>Project</span>
            <div data-dojo-type="dijit/Menu" id="projectMenu">

            <div data-dojo-type="dijit/MenuItem"
                      data-dojo-props="iconClass:'dijitEditorIcon   appCreateSharedPrj', onClick:function() {newspreadsheet()}">new</div>
            </div>
            </div>`

    <!-- file menu bar end-->
    <div width="100%" style="height: 100%;">
         <zssjsp:page id = "page3">
        <zssjsp:div  width="100%" height ="100%" apply = "com.project.handler.prjHandler","resource.js.src.js">
<%--    <zssjsp:window  id = "win"  height="100%" width="100%" > --%>
    <zssjsp:spreadsheet id = "ss" 
     vflex="1" hflex="1" maxVisibleRows="150" maxVisibleColumns="40"
     showToolbar="true" showSheetbar="true" showFormulabar="true" />

     </zssjsp:div>

    </zssjsp:page>
    </div>`

js code

newspreadsheet = function(){

    prjHandler.newbook();
}

javacode

public void doRefresh() throws Exception {
   Path path = new Path("//page3/ss");

    doAfterCompose(path.getComponent("//page3/ss"));

}

public void newbook() throws Exception {
    System.out.println("inside");
    doRefresh();
    System.out.println("inside");
    ss.setSrc("/root/Desktop/book/hellozss.xlsx");

}

我在这行doAfterCompose(path.getComponent(“// page3 / ss”))中得到一个空指针错误;

任何帮助将不胜感激

谢谢!!

0 个答案:

没有答案