I was able to resolve this issue by adding 'rendered' attribute and corresponding method to backing bean. I am now getting a diff issue. The first execution of the command button works fine - i see my data table and my map. The second attempt updates the data table but not the map. There is a browser error as follows:
ebpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Timestamp: Fri, 3 May 2013 19:26:37 UTC
Message: Script error
Line: 0
Char: 0
Code: 0
URI:
https://maps.gstatic.com/intl/en_us/mapfiles/api-3/12/10/main.js-----------------------
Any thoughts about the root cause?
--------------------------------------------------------
On Friday, May 3, 2013 10:05:27 AM UTC-4, Daniel Dausch wrote:
I am using JSF 2.1.21 (Mojarra), RichFaces 4.3 and GMap4sf. My source code snippet is as follows:
<h:form id="form2">
<h:panelGrid columns="2">
<h:outputText value="Enter your address like 'Boston, MA' :"/>
<h:inputText id="txtAddress" value="#{propertyBean.address}"/>
<a4j:commandButton value="Get my location on the map" action="#{propertyBean.search}"
render="map2,myTable2"
limitRender="true">
</a4j:commandButton>
</h:panelGrid>
<a4j:region id="regionMap">
<h:panelGrid id="searchMap" columns="2" border="2" cellpadding="5px">
<m:map id="map2" width="450px" height="375px" partiallyTriggered="false" latitude="#{propertyBean.targetPlace.lat}"
longitude="#{propertyBean.targetPlace.lon}">
</m:map>
<rich:extendedDataTable id="myTable2" var="place"
value="#{propertyBean.nearbyProps}"
rows="0" width="450px" height="100px">
.......
I am using a a4j:commandButton which calls the 'search' method on a Backing Bean. This ends up creating a object called targetPlace and a list of nearby Properties to the target. On the render phase, the map remains blank but the Data Table is properly displayed. The only way to display the map is to refresh the entire page which of course defeats the purpose of using ajax. When trying to figure this out I did notice the script error in IE8 which seems to reference the map2 entity. I stripped out the markers and the like to make it simpler but still getting the same error and also the same refresh issue. It functions the same way in Mozilla. Here is a snippet form the source view of the page:
window.gmaps4jsf.createMap({id: 'form2:map2',enableScrollWheelZoom: false,zoom: 11,location: {latitude: , longitude: , address: ''},
jsVariable: '', parentFormID: 'form2', mapType: google.maps.MapTypeId.ROADMAP, submitOnValueChange: 'false',
mapStateHiddenFieldID: 'com_googlecode_gmaps4jsf_mapStatemap2', showDefaultControls: 'true',
autoReshape: false, ajaxBehavior: {}}, function (parent) {
--
You received this message because you are subscribed to the Google Groups "gmaps4jsf-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
gmaps4jsf-de...@googlegroups.com.
To post to this group, send email to
gmaps4...@googlegroups.com.
Visit this group at
http://groups.google.com/group/gmaps4jsf-dev?hl=en.
For more options, visit
https://groups.google.com/groups/opt_out.