0

Map24 as zul component: "failed to invoke zkTabpanel2.init A has no properties"

asked 2008-11-07 10:26:19 +0800

cvarona gravatar image cvarona
554 1 6

Hi,

I have written a wrapper in order to have Navteq's map component(former map24) available as a zul component.

When I try to set it up directly within a tabpanel, like this:

  
<tabbox id="_tabBox0" focus="false" orient="horizontal" width="100%" height="100%">
    <tabs id="_tabs0" align="start">
      <tab id="_tab1" closable="false" selected="true" label="Mapa" />
      <tab id="_tab2" label="Datos" focus="false" closable="false" selected="false" />
    </tabs>
    <tabpanels id="_tabPannels0">
      <tabpanel id="_tabPannel1">
         <map24 id="_map" focus="false" 
         startMapView="{UpperLeftLongitude: -774.989, UpperLeftLatitude: 2638.55, LowerRightLongitude: 365.375, LowerRightLatitude: 2136.933}" 
         height="100%" width="100%" use="com.ptb.clerzk.map24.CzkMap24" host="${map24host}" licence="${map24licence}" mapObjectBuilder='${artifacts["mob_map"]}' />
      </tabpanel>
      <tabpanel id="_tabPannel2" focus="false">
...

I get the following error popup upon loading the window the tabbox is inserted in:

"failed to invoke zkTabpanel2.init A has no properties"

This won't happen if my map24 component is child to some other component, such as a grid's row or a box, even if the grid or box is included within the aforementioned tabpanel.

I suspect this is due to a clumsy map24.dsp:

<%@ taglib uri="/WEB-INF/tld/web/core.dsp.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/zk/core.dsp.tld" prefix="z" %>
<c:set var="self" value="${requestScope.arg.self}"/>
<div id="${self.uuid}"${self.outerAttrs}${self.innerAttrs} z.type="map24z.map24.Map24" 
     z.host="${self.host}" 
     z.licence="${self.licence}" 
     z.startMapView="${self.startMapView}">
  <div id="${self.uuid}!real" style="width:100%;height:100%;" />
</div>

(map24 paints the map on a div, like gmaps does)

Any clue as to how to improve this .dsp would be much appreciated.

With kind regards

César Varona

delete flag offensive retag edit

3 Replies

Sort by » oldest newest

answered 2008-11-10 06:23:07 +0800

dennis gravatar image dennis
3669 1 6
http://www.javaworld.com....

Could you open the debug_js flag in zk.xml to see which line of zk js file cause this issue.
(http://www.zkoss.org/doc/devref/ch08s01s04.html)
and please also provide the version of ZK that you have.

link publish delete flag offensive edit

answered 2008-11-10 09:52:38 +0800

cvarona gravatar image cvarona
554 1 6

Hi,

I'm using zk 3.5.1; this is what I get when enabling js debug:

Hiba: el has no properties
Forrásfájl: http://localhost:8080/backbone/zkau/web/js/zk/zk.js.dsp
Sor: 6705

Line 6705 is var cn = el.className in the following js snippet:

zk.addClass = function (el, clsnm, bAdd) {
	if (bAdd == false) {
		zk.rmClass(el, clsnm);
		return;
	}

	if (!zk.hasClass(el, clsnm)) {
		var cn = el.className;
		if (cn.length) cn += ' ';
		el.className = cn + clsnm;
	}
};

Thanks a lot for taking an interest in this seemingly obscure issue

César Varona

link publish delete flag offensive edit

answered 2008-11-10 10:20:38 +0800

flyworld gravatar image flyworld
155 3

this is a bug of ZK, and its fixed in the newest freshly version
u can download it from here

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: 2008-11-07 10:26:19 +0800

Seen: 128 times

Last updated: Nov 10 '08

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