Note that there are some explanatory texts on larger screens.

plurals
  1. POjspx pass variables
    primarykey
    data
    text
    <p>I'm using Spring Roo and jspx to make a system for managing a property investment portfolio. </p> <p>In my "propertys/show.jspx" file I have embeded a map using the Google Maps API and now I want the post/zip code of the property to be passed into the geocoding method to display the location of the property on the map.</p> <p>I am relatively new to jsp(x), however I have tried various options such as using the postcode "id" value or using ${property.postcode}/ ${property.getPostcode()} but none of these work. Surely it is possible what I am trying to do, and I've searched for hours online but have struggled to find anything which helps.</p> <p>here is my code:</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt; &lt;div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:embed="urn:jsptagdir:/WEB-INF/tags/embed" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" version="2.0"&gt; &lt;jsp:directive.page contentType="text/html;charset=UTF-8"/&gt; &lt;jsp:output omit-xml-declaration="yes"/&gt; &lt;page:show id="ps_propertymodule_model_Property" object="${property}" path="/propertys" z="WKsfPr4ho5x13a9S80pO1Z6yVzU="&gt; &lt;table width="100%;"&gt; &lt;tr&gt; &lt;td width="60%"&gt; &lt;field:display field="propertyNameNumber" id="s_propertymodule_model_Property_propertyNameNumber" object="${property}" z="DRkvOGCjByMk2N7UunO4fD8LJfc="/&gt; &lt;field:display field="streetName" id="s_propertymodule_model_Property_streetName" object="${property}" z="caugN9DlFqoZLN+WEKIjaJEQUSI="/&gt; &lt;field:display field="townCity" id="s_propertymodule_model_Property_townCity" object="${property}" z="Fp+KSaGrgdbXhRzllkBo9FxmXIM="/&gt; &lt;field:display field="county" id="s_propertymodule_model_Property_county" object="${property}" z="mmJB81/8iBFbt+jXICA9q8xCDHw="/&gt; &lt;field:display field="postcode" id="s_propertymodule_model_Property_postcode" object="${property}" z="j1qr8EujBkOLnsX1vcgFaPlEWtU="/&gt; &lt;br/&gt; &lt;br/&gt; &lt;field:display date="true" dateTimePattern="${property_datepurchased_date_format}" field="datePurchased" id="s_propertymodule_model_Property_datePurchased" object="${property}" z="B22znN56FtmM/zueTwnOcjNl83k="/&gt; &lt;field:display field="pricePaid" id="s_propertymodule_model_Property_pricePaid" object="${property}" z="CQLyDqQhFtqoYfMusAB/XeA+wW0="/&gt; &lt;field:display field="stampDuty" id="s_propertymodule_model_Property_stampDuty" object="${property}" z="x7sgRlL8ROhdb9MonWP33N4Ishs="/&gt; &lt;field:display field="legalCost" id="s_propertymodule_model_Property_legalCost" object="${property}" z="TH0DgdlKfeFDefSgq+HDVebcxm0="/&gt; &lt;field:display field="agentFee" id="s_propertymodule_model_Property_agentFee" object="${property}" z="05bXxWqJcMzgbwtVBHUujPWU7ZA="/&gt; &lt;br/&gt; &lt;br/&gt; &lt;field:display field="area" id="s_propertymodule_model_Property_area" object="${property}" z="Eb5a0xmk5qSFaKZ3BYMGR7lNYw8="/&gt; &lt;field:display field="salePrice" id="s_propertymodule_model_Property_salePrice" object="${property}" z="cQHnoPj/QNnb2XwRclq6n4zR+gs="/&gt; &lt;field:display field="saleCommission" id="s_propertymodule_model_Property_saleCommission" object="${property}" z="ULPRSdiwV/tk+kS59uyk16TkcoY="/&gt; &lt;field:display field="legalExpenses" id="s_propertymodule_model_Property_legalExpenses" object="${property}" z="/a0+xD2IyDttEZpI9zlcOpruOaQ="/&gt; &lt;field:display field="comments" id="s_propertymodule_model_Property_comments" object="${property}" z="RDKzYGFdOQUXNcAhV3/JGF8v7V0="/&gt; &lt;field:display field="image" id="s_propertymodule_model_Property_image" object="${property}" z="TBQCQkvQcyTDVJQw7l95WI6zt9U="/&gt; &lt;field:display field="vacant" id="s_propertymodule_model_Property_vacant" object="${property}" z="03Pa/jpb5PtZRPMAQzLryud0dBs="/&gt; &lt;c:set var="post_code" value="${property.postcode}" /&gt; &lt;/td&gt; &lt;td&gt; &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBQaHw1aSWtIjQzAiriBPC3hvm7Bs1R35U&amp;amp;sensor=false"&gt;&lt;jsp:text&gt;&lt;/jsp:text&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(51.10,-0.84), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); codeAddress(); } function codeAddress() { var address = document.getElementById(address).value; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); } else { alert('Geocode was not successful for the following reason: ' + status); } }); } google.maps.event.addDomListener(window, 'load', initialize); // ]]&gt; &lt;/script&gt; &lt;div id="map_canvas" style="width: 250px; height: 250px"&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/page:show&gt; &lt;/div&gt; </code></pre> <p>If anyone can give me any hints or tips that would be so appreciated, since I really think this is a basic problem and it is really frustrating me not being able to solve it!</p> <p>Thanks</p> <p>Steve</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload