Using primefaces 6.2
I have this simple code:
<p:gmap center="50.848227, 4.356564" zoom="9" type="map" style="width:100%;height:600px" model="#{welcomePage.mapModel}">
<p:ajax event="overlaySelect" listener="#{welcomePage.onMarkerSelect}" />
</p:gmap>
In header of html page:
<script src="http://maps.google.com/maps/api/js?key=*****" type="text/javascript"></script>
.
@WebPage
public class WelcomePage implements Serializable {
private static final long serialVersionUID = -2444997383150958426L;
@Getter
@Setter
MapModel mapModel;
@PostConstruct
public void init() {
mapModel = new DefaultMapModel();
... add data to mapModel...
}
public void onMarkerSelect(OverlaySelectEvent event) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "test"));
}
}
I dont know why but the method onMarkerSelect is never fired. Anybody can give me a hint? I never used Gmap primefaces component before.
We were using default header and footer scripts, which comes from another team of our department. Apparently they use heavily jquery scripts and i noticed in the Safari webinfo windows there are multiple jquery versions used. Primefaces uses jquery plugins 1.12.1 and our team uses 1.11.0. Seems the browser accepts it all, JSF doesn't generate any error and AJAX request is fired, but the executed scripts, due to jquery version clashes, seems to silently run some code which is not compatible with the Primefaces javascript files. When removing header and footer scripts, everything works as expected!
Would be a nice feature of jQuery to detect this kind of clashes of course and give some kind of warning ^^. I asked the other team to investigate this issue. Case closed.