0

error "Failed to process setAttr o is undefined (TypeError)"

asked 2012-08-23 15:15:08 +0800

PratikThacker gravatar image PratikThacker
9

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>
----

composer file
 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

Initially error was coming due to missing timelinez.jar so I have copied timelinez.jar from previous project..
Now can you tell what minimum other jar files I need to verify?.. Or some other solution if any...

Waiting for reply...
Pratik

delete flag offensive retag edit

6 Replies

Sort by » oldest newest

answered 2012-08-24 06:51:43 +0800

PratikThacker gravatar image PratikThacker
9

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)

link publish delete flag offensive edit

answered 2012-08-30 06:15:46 +0800

francishsiao gravatar image francishsiao
145 2

Hi,
I can't reproduce the error neither in ie9 and firefox. They work fine.
What your zk version is?

Best regards,

link publish delete flag offensive edit

answered 2012-08-30 14:44:15 +0800

PratikThacker gravatar image PratikThacker
9

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..

link publish delete flag offensive edit

answered 2012-09-05 04:33:27 +0800

francishsiao gravatar image francishsiao
145 2

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?

link publish delete flag offensive edit

answered 2012-09-05 06:23:58 +0800

cocoes gravatar image cocoes flag of Spain
94 6

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.

link publish delete flag offensive edit

answered 2012-09-05 06:50:18 +0800

cocoes gravatar image cocoes flag of Spain
94 6

updated 2012-09-05 06:51:36 +0800

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.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-08-23 15:15:08 +0800

Seen: 341 times

Last updated: Sep 05 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More