You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by sommeralex <al...@gmail.com> on 2013/01/12 01:53:32 UTC
zoneManager keeps being null
Hello, ,
I have a wired problem. My ZoneManager keeps being null:
JS:
function updatePage(response){
alert ("id: " + zoneId);
alert (urlSetMsgPositionAndSize);
var zoneManager = Tapestry.findZoneManagerForZone(zoneId);
alert ("zone " + zoneManager);
zoneManager.updateFromURL(urlSetMsgPositionAndSize);
}
alert zone gives "zone null", but urlSetMsgPositionAndSize is
/message/createmessage3:setmsgpositionandsize?t:ac=90
and alert of alert ("id: " + zoneId); is "[object HTMLdivelement]"
my js loader functions:
function initializeOnLoad(centerX, centerY, _scopeRadius,
_minMsgScopeInMeters, _maxMsgScopeInMeters, _urlSetMsgPositionAndSize,
_zoneId) {
google.maps.event.addDomListener(window, 'load', initialize(centerX,
centerY, _scopeRadius, _minMsgScopeInMeters, _maxMsgScopeInMeters,
_urlSetMsgPositionAndSize, _zoneId));
}
function initialize(centerX, centerY, _scopeRadius, _minMsgScopeInMeters,
_maxMsgScopeInMeters, _urlSetMsgPositionAndSize, _zoneId) {
var mapOptions = {
zoom: 12,
center: new google.maps.LatLng(centerY, centerX),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"),
mapOptions);
urlSetMsgPositionAndSize = _urlSetMsgPositionAndSize;
alert (urlSetMsgPositionAndSize);
zoneId = _zoneId;
scopeRadius = _scopeRadius;
minMsgScopeInMeters = _minMsgScopeInMeters;
maxMsgScopeInMeters = _maxMsgScopeInMeters;
google.maps.event.addListener(map, 'dragend', onMapDragEnd);
google.maps.event.addListenerOnce(map, 'idle', function(){
onSlide(scopeRadius);
});
setMarker(map.getCenter());
}
my java class has a
@InjectComponent
private Zone updateZone;
which is a parameter for my JS call:
Link linkSetMsgPosAndSize =
componentResources.createEventLink("setMsgPositionAndSize");
javaScriptSupport.addScript("initializeOnLoad(%s, %s, %s,%s,%s,'%s',
%s);", groupCenter.getCentroid().getX(), groupCenter.getCentroid().getY(),
group.getMessageRadius(), group.getMinMessageRadius(),
group.getMaxMessageRadius(), linkSetMsgPosAndSize.toURI(),
updateZone.getClientId());
i did the same for another page where it is working. but here it keeps
saying that the zoneManager is null. tge tapestry page itself shows the
error message:
updateZone does not have associated Tapestry.ZoneManager object.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/zoneManager-keeps-being-null-tp5719262.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: zoneManager keeps being null
Posted by sommeralex <al...@gmail.com>.
fixed. it seems that i just had to take care of the right order of loading
the js snippeds (setupRender, afterRender were confused in my code)
--
View this message in context: http://tapestry.1045711.n5.nabble.com/zoneManager-keeps-being-null-tp5719262p5719264.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org