I am developing a functionality in my jsf application, which should retrieve the lat and lon of places from the database and plot it in Google map. Since gmaps4jsf library is not updated with google maps java script api v3, i’m using google maps java script api as it is. The problem is that I can’t call the script to plot the place in map after retrieving the lat and lon (via jsf).
What is the solution to this problem?
Just let JSF print it as if it’s a JS variable.
(the
<h:outputScript>generates a HTML<script type="text/javascript">element, if you’re still on old JSF 1.x, use<h:panelGroup><script>instead and also<h:outputText>instead of EL in template text)with something like
Remember: JSF basically generates HTML. JS is part of HTML response.