-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
Can any one help on Tree issue?
Getting the following error === org.zkoss.zk.ui.impl.DesktopImpl service:713 [Desktop SRDT1:/main.zul] client error: Failed to process setAttr'null' is null or not an object (TypeError), when trying to click the children of the tree.
This is the code
public class ProcessTreeitemRenderer implements TreeitemRenderer {
public void render(Treeitem item, Object data) throws Exception {
DefaultTreeNode t = (DefaultTreeNode)data;
if (t.getData() instanceof StepUI){
StepUI step = (StepUI)t.getData();
item.setValue(step);
Treecell tcName= new Treecell();
tcName.setImage(step.getTaskImage());
Label l=new Label(step.getStep().getName());
l.setStyle(getStyle(step.getStep().getStatus()));
tcName.appendChild(l);
Treerow tr = null;
if(item.getTreerow()==null){
tr = new Treerow();
tr.setParent(item);
}else{
tr = item.getTreerow();
tr.getChildren().clear();
}
//Attach treecells to treerow
tcName.setParent(tr);
item.setOpen(false);
}
}
Thanks in advance.............
HI
Can you provide the sample to reproduce this issue?
And are you using 5.0.9?
Hi,
Thank you for the response............
Yes, am using zk 5.0.9.
This is the main.zul file
<?xml version="1.0" encoding="UTF-8"?>
<?page id="main" title="Eum Application" style="height:100%"?>
<zk 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:a="http://www.zkoss.org/2005/zk/annotation">
<window id="application"
use="com.web.presentation.main.EumWindow" width="100%">
<vbox spacing="1px">
<include src="/common/header.zul?pageId=header"
style="background:#455F55;" />
<tabbox id="tabbox" orient="vertical" height="560px"
width="990px" style="background:#D0EAE9">
<tabs width="30px" height="100%">
<tab id="inboxTab" image="/img/My_Inbox_15.gif"
forward="onSelect=onNotify" tooltiptext="Inbox" />
<tab id="userTab" image="/img/User_Manager_15.gif"
visible="${spaceOwner.role.directoryManager}"
forward="onSelect=onNotify" tooltiptext="Directory View" />
<tab id="processTab"
image="/img/Process_Manager_15.gif"
visible="${spaceOwner.role.processManager}"
forward="onSelect=onNotify" tooltiptext="Process View" />
<tab id="configTab"
image="/img/EUM_Admin_15.gif"
visible="${spaceOwner.role.administrator}"
forward="onSelect=onNotify" tooltiptext="Administration View" />
<tab id="ERTTab"
image="/img/reporting Tab.gif"
forward="onSelect=onNotify" tooltiptext="ERT View" />
<tab id="adminTab" image="/img/EUM_Admin_15.gif"
visible="false" tooltiptext="System View" />
</tabs>
<tabpanels>
<tabpanel>
<include src="/inbox/inbox.zul?pageId=inbox" />
</tabpanel>
<tabpanel fulfill="userTab.onSelect"
visible="${spaceOwner.role.directoryManager}">
<include
src="/user/userManager.zul?pageId=users" />
</tabpanel>
<tabpanel fulfill="processTab.onSelect"
visible="${spaceOwner.role.administrator}">
<include
src="/process/processManager.zul?pageId=processManager"
manager="true" />
</tabpanel>
<tabpanel fulfill="configTab.onSelect"
visible="${spaceOwner.role.administrator}">
<include src="/config/config.zul" />
</tabpanel>
<tabpanel fulfill="ERTTab.onSelect"
visible="${spaceOwner.role.administrator}">
<include src="/ert/ertmain.zul?pageId=ertOverview" />
</tabpanel>
<tabpanel fulfill="adminTab.onSelect"
visible="${spaceOwner.role.administrator}">
<include src="/sysadmin/sysadmin.zul?" />
</tabpanel>
</tabpanels>
</tabbox>
</vbox>
</window>
</zk>
This is processdetailpopup.zul, called from main.zul->processManager.zul
<?xml version="1.0" encoding="UTF-8"?>
<?page title="Process Admin" style="height:100%"?>
<zk 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:a="http://www.zkoss.org/2005/zk/annotation"
xsi:schemaLocation="http://www.zkoss.org/2005/zul/zul.xsd ">
<window id="processdetailpopup"
width="410px"
border="normal"
closable="true"
title="Process Details"
use="com.web.presentation.process.ProcessDetailsPopup"
xmlns:w="http://www.zkoss.org/2005/zk/client" >
<vbox spacing="2px">
<tree
id="tree"
sclass="dottree"
model="@{requestsUI}"
pageSize="10" height="200px"
itemRenderer="@{processdetailpopup.renderer}"
forward="onSelect=processdetailpopup.onNotify">
<treecols>
<treecol label="Process"></treecol>
</treecols>
</tree>
<vbox>
<include id="processDetailInc"
src="/process/processDetails.zul?pageId=ProcessDetails"
w:onShow="jq(this).show().fadeIn();"
w:onHide="jq(this).hide().fadeOut();"
w:onClick="this.setValue('clicked');"
visible="false" ></include>
<include id="taskDetailInc"
src="/process/taskDetails.zul?pageId=TaskDetails"
w:onShow="jq(this).show().fadeIn();"
w:onHide="jq(this).hide().fadeOut();"
w:onClick="this.setValue('clicked');"
visible="false" ></include>
</vbox>
</vbox>
</window>
</zk>
and previous code is for implementation.
Thanks in advance......
Got the solution, now the problem is fixed...............
By replacing visible="false" with processdetailpopup.visible="false" in processdetailpopup.zul, it worked....
Asked: 2011-12-02 08:03:03 +0800
Seen: 729 times
Last updated: Dec 06 '11
ZK studio and eclipse outline problem
ZK Package configuration problem
Eclipse Autocomplete not working in ZUL files...
Syntax Error mark ... help me!
Manual Installation of ZK Studio
Can't see button text whilst running simple demo
Adding Vbox to Center layout in Java