-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all.
I'm using Google Maps API in a ZK simple application and I'm having some trouble when I want to communicate the map state to the components of ZK.
By the way this code is an example:
<div>
<!-- HIDDEN FIELD USED TO COMMUNICATE WITH THE GOOGLEMAP -->
<input type="hidden" name="txt" value="Hello" id="inputLat" onchange="changeLat(this)" onclick="setLatValue(this)">
<input type="hidden" name="txt" value="Hello" id="inputLng" onchange="changeLng(this)" onclick="setLngValue(this)">
<script type="text/javascript">
function setLatValue(val){
var res = val.value;
res = res.replace(".",",");
res = res.substring(0, 10);
zk.Widget.$('$latitude').setValue(res);
var evt = zk.Event(zk.Widget.$('$latitude'), "onChange", {toServer:true});
zAu.send(evt);
}
function setLngValue(val){
var res = val.value;
res = res.replace(".",",");
res = res.substring(0, 10);
zk.Widget.$('$longitude').setValue(res);
var evt = zk.Event(zk.Widget.$('$longitude'), "onChange", {toServer:true});
zAu.send(evt);
}
</script>
</div>
<div id="map-canvas"/>
</body>
</html>
In the zul file I have something like that:
<doublespinner id="latitude" value="@save(gpsvm.latitude, before='goTo')" width="140px" />
<doublespinner id="longitude" value="@save(gpsvm.longitude, before='goTo')" width="140px"/>
In the js file that control the map I fire an onchange event that change the value of the two html input component, but then I want to put this value in the zk doublespinner components.
How could I do that? Should I send an AuRequest to the server? And if so, how?
Thanks a lot.
P.S. Sorry, I'm a newbie!
Resolved with an appropriate zAu.send.
Anyway, thanks to all!
Asked: 2013-12-13 16:07:28 +0800
Seen: 16 times
Last updated: Dec 17 '13
Do not update to ZK Studio 2.0
Catch Server 503 Error - Or Catch Stale Page
how to save spreadsheet data into postgres database?
One controller file with multiple zul file
Why am I getting authentication error for ZK studio activation?
How can i make Tomcat (with virtual hosts) to parse the zul page in subfolders?