-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I am getting an error "Failed to process setAttr o is undefined (TypeError)"...
Following code is working fine in one of my project
but when i try to implement same thing in another project it gives above mention error..
Zul file --- <tabpanel style="padding-top: 2px; padding-left: 1px; padding-right: 1px;"> <timeline height="100%" width="100%"> <bandinfo width="70%" id="b1" intervalUnit="day" intervalPixels="50" > </bandinfo> <bandinfo width="30%" intervalUnit="month" intervalPixels="100" syncWith="b1" > </bandinfo> </timeline> </tabpanel> ----
OccurEvent event =new OccurEvent(); event.setText("Having a trip to USA"); event.setStart(new Date(Date.parse("Aug 01 2012 00:00:00 GMT-0500"))); event.setEnd(new Date(Date.parse("Sep 01 2012 00:00:00 GMT-0500"))); b1.addOccurEvent(event);//if this line is removed error does not occure
Waiting for reply...
Pratik
In Internet Explorer 9 it gives following error for the same:
24 Aug, 2012 12:07:17 PM org.zkoss.zk.ui.impl.DesktopImpl service:721
SEVERE: [Desktop z_4h00:/module/user-home.zul] client error: Failed to process
setAttr
Unable to get value of the property 'showLoadingMessage': object is null or undefined (TypeError)
Hi,
I can't reproduce the error neither in ie9 and firefox. They work fine.
What your zk version is?
Best regards,
Hi,
I have observed its behavior.
In my code there are 3 tabpanel.. And OccurEvent is added from composer file .
It gives above error if timeline is kept in 2nd or 3rd panel except 1st..
Error does not produce if I am putting that timeline in 1st panel..
One more thing , I need your help
if I put that timeline in 1st panel then it is working fine,
but as soon as I click on 2nd panel and again come to the 1st panel which the event data wipes..
So, it shows empty timeline..
Hi PratikThacker and vicent,
Would you like to provide reproduceable code as detail as possible for us to test to find out the root cause and solution?
Hi,
I'm facing the same problem on Explorer 9 and ZK 6.0.2.
An exception is thrown on every tree row added to a not visible tabpanel. The exception is like this (in Spanish)
16:32:37,022 SEVERE [Desktop z_7qb:/mypath/index.zul] client error: Fallo al procesar rm
No se puede obtener valor de la propiedad 'style': el objeto es nulo o está sin definir (TypeError)
Translating to english will be something like
16:32:37,022 SEVERE [Desktop z_7qb:/mypath/index.zul] client error: Failed processing rm
'style' property value can't be obtained : object is null or it's not defined (TypeError)
The exception is also shown on a nice pink browser popup ;-) .
I don't have experienced such error on other browsers... As PratikThacker says, the exception is not thrown when the row is added dinamically to the tree included in the visible tabpanel.
Hi francishsiao,
It will take to me a couple of days to put a reproduceable code, but here's a summary:
- ZUL file
<tabbox vflex="1" id="miTab"> <tabs> <tab label="1" id="1"></tab> <tab label="1" id="2"></tab> ... more tabs ... </tabs> <tabpanels vflex="1"> <tabpanel id="tb1" > <tree id="myTree1" vflex="1" hflex="1" sclass="myclass" > <treecols sizable="true"> <treecol label="1" id="c1" sortAscending="${des_asc}" sortDescending="${des_dsc}" hflex="2"></treecol> <treecol label="2" id="c2" sortAscending="${cod_asc}" sortDescending="${cod_dsc}" visible="false" ></treecol> ... more cols ... <treechildren> </treechildren> </tree> </tabpanel> <tabpanel id="tb2"> <tree id="myTree2" vflex="1" hflex="1"> <treecols sizable="true"> <treecol label="A" id="cA" sortAscending="${des_asc}" sortDescending="${des_dsc}" hflex="2"></treecol> <treecol label="B" id="cB" sortAscending="${cod_asc}" sortDescending="${cod_dsc}" visible="false" hflex="1" ></treecol> ... more cols ... <treechildren> </treechildren> </tree> </tabpanel> ... more tabpanels ...
- Tree Renderer file
public void render(Treeitem treeItem, Object data, int arg2) throws Exception { DefaultTreeNode treeNode = (DefaultTreeNode) data; treeItem.setValue(treeNode); Treerow tr; if (treeItem.getTreerow() == null) { tr = new Treerow(); tr.setParent(treeItem); } else { tr = treeItem.getTreerow(); tr.getChildren().clear(); } MyRowInfo row = (MyRowInfo)treeNode.getData(); Treecell desc=new Treecell(); desc.appendChild(new Label(mytext)); if (mycondition) { desc.setClass("myclass"); } tr.appendChild(desc); Treecell cell2=new Treecell(); Div mydiv=new Div(); mydiv.appendChild(new Label(myothertext)); if (somecondition) { mydiv.setClass("oneclass"); } else if (somecondition) { mydiv.setClass("otherclass"); } else { mydiv.setClass("thirdclass"); } cell2.appendChild(mydiv); tr.appendChild(cell2); ... more cells ... if (!treeItem.isListenerAvailable(Events.ON_OPEN, true)) { treeItem.addEventListener(1000,Events.ON_DOUBLE_CLICK, new EventListener() { public void onEvent(Event event) throws Exception { Treeitem ti=(Treeitem)event.getTarget(); ti.setSelected(true); DefaultTreeNode dtn=(DefaultTreeNode)ti.getValue(); MyRowInfo row = (MyRowInfo)dtn.getData(); row.changeOpen(); ti.setOpen(row.isOpen()); } }); treeItem.addEventListener(1000,Events.ON_OPEN, new EventListener() { public void onEvent(Event event) throws Exception { Treeitem ti=(Treeitem)event.getTarget(); ti.setSelected(true); DefaultTreeNode dtn=(DefaultTreeNode)ti.getValue(); MyRowInfo row = (MyRowInfo)dtn.getData(); row.setOpen(((OpenEvent)event).isOpen()); } }); treeItem.addEventListener(1000,Events.ON_RIGHT_CLICK, new EventListener() { public void onEvent(Event event) throws Exception { ((Treeitem)event.getTarget()).setSelected(true); } }); } if (tr.getContext()==null) { Menupopup popup=new Menupopup(); popup.setPage(treeItem.getPage()); popup.setWidth("300px"); if (somecondition) { Menuitem mnc=new Menuitem("sometext"); mnc.setImage("/images/image.gif"); mnc.setStyle("background-repeat:none"); ComponentsCtrl.applyForward(mnc, "somepoint.onClick"); popup.appendChild(mnc); ...more menuitems ... } tr.setContext(popup); } treeItem.setOpen(row.isOpen()); DefaultTreeModel model = (DefaultTreeModel) treeItem.getTree().getModel(); if (row.isOpen()) model.addOpenObject(data); }
So this code fails on Internet Explorer 9 during the first startup. It sends an exeption on every row added to a tree in a not visible tabpanel.
Asked: 2012-08-23 15:15:08 +0800
Seen: 341 times
Last updated: Sep 05 '12