在创建参数时,我尝试将参数传递给zul:
.zul文件:
<window xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:zk="http://www.zkoss.org/2005/zk"
xmlns:ca="http://www.zkoss.org/2005/zk/client"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd "
border="normal"
closable="false"
position="center,center"
width="383px"
height="270px"
onCancel="self.detach();"
id="decisionCommentWindow"
title="${c:l('approvalTaskWindow.title')}"
use="handlers.ZulHandler">
<zk if="${isManufacturingKey}">
<checkbox id="checkbox_id" label="check" />
</zk>
</window>创建zul的java代码:
...
Map args = new HashMap<String, Boolean>();
Boolean isManufacturing = true;
args.put("isManufacturingKey", isManufacturing);
ZulHandler window = Preconditions
.checkNotNull((ZulHandler) Executions.createComponents(
"/decision_comment_window.zul", null, args));
window.setTitle(decisionModel.getName() + " decision");
if (isManufacturing) {
Checkbox checkbox = (Checkbox) Path
.getComponent("/decisionCommentWindow/emergency_change_checkbox_id");
checkbox.setChecked(workflow.getEmergencyChange());//I have Null pointer here because checkbox is null
}
...这里有空指针。
你能帮帮我吗?
发布于 2014-01-10 15:27:39
感受不同之处:
错误变体
<zk if="${isManufacturingKey}">右变式
<zk if="${arg.isManufacturingKey}">也许这个问题的原因是使用zk框架的旧版本--我不知道。
https://stackoverflow.com/questions/21044703
复制相似问题