-
1. How to get the updated backing bean value to pass parameter for JS function
ilya_shaikovsky Mar 9, 2011 9:32 AM (in response to v.bannur)you could use data attribute to serialize any object from server side and use later in oncomplete. like data=#{someBean} and oncomplete=alert('event.data.beanProperty')...
-
2. How to get the updated backing bean value to pass parameter for JS function
v.bannur Mar 10, 2011 4:18 AM (in response to ilya_shaikovsky)Hi ILya,
Its working fine. Here the data is the selected object and on selected object it creates marker.
However onload i need to create markers for all objects. I get to know that to use oninit attribute. But how can i pass the list of objects to JS.
Can you please give me some hints?
Here is the Code:
<rich:gmap gmapVar="map" zoom="#{gmBean.zoom}"
style="width:600px;height:600px" gmapKey="#{gmBean.gmapkey}"
id="gmap" enableContinuousZoom="false" enableDoubleClickZoom="true"
enableInfoWindow="true" oninit="loadMarkers('#{gmBean.point}');" locale="getDefaultLocale()" />
<a4j:jsFunction name="showPlace" data="#{gmBean.selectedLocation}"
reRender=":zoom"
oncomplete="showExadel(data.lat,data.lng,data.zoom);return false;">
<a4j:actionparam name="id" assignTo="#{gmBean.currentId}"></a4j:actionparam>
</a4j:jsFunction>
function showExadel(lat,lng,zoom) {
var lat=lat;
var lng=lng;
var zoom=zoom;
//alert(lat+"--"+lng);
var point = new GLatLng(lat, lng);
map.setCenter(point);
var marker = createMarker(point,'Go to the <a target="_blank" href="http://www.exadel.com">Exadle Web Site</a>');
map.setZoom(zoom);
map.addOverlay(marker);
}
-
3. Re: How to get the updated backing bean value to pass parameter for JS function
ilya_shaikovsky Mar 10, 2011 5:31 AM (in response to v.bannur)so pass List or objects using data in the same way. it shold be serialized to JS array as I believe.