-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 If you use a zone, you can call
var zoneObject=Tapestry.findZoneManagerForZone('<DOM id of zone>'); zoneObject.updateFromURL('<url>', {}); in JS. When generating the JS code in your TML, you can generate the correct URL by having something like the following in your page / component class: @Inject ComponentResources resources; ... final String url = resources.createEventLink("getGroupsOnLocation").toString(); and then put that url into your JS code via the TML. If you have an event context, you can of course add that to the event link. At least it worked for me that way. Hope that helps - - Arno Am 30.05.2012 21:29, schrieb sommeralex: > Hello! > > I am using a javascript plug in which is giving me the coordinates > of a user. After the coordinates are retrieved, i want tapestry to > reload a specific element - my list (which now should show > localized entries) What i have done so far - and what is working - > is that my js script is calling my java function > onGetGroupsOnLocation(), taking the JSONArray and writing out that > JSONArray via javascript > document.getElementById("list").innerHTML=list; > > BUT this is not what i want. I would prefer that I can reload the > area <t:grid source="list" /> of my tml. So what i am looking for > is a way to update a specific area of my tml, if a tapestry > function of my page is invoked. > > I am happy for any help.. > > public JSONArray onGetGroupsOnLocation(){ Double lat = > Double.parseDouble( request.getParameter("lat") ); Double lng = > Double.parseDouble( request.getParameter("lng") ); Double > radiusInMeters = Double.parseDouble( > request.getParameter("radius") ) / 2; Geometry location = > GeometryService.getPolygon(new GeoPoint(lat, lng), > radiusInMeters.intValue()); groups = > groupService.getGroupsOnLocation(location); JSONArray jsGroups = > new JSONArray(); for(Group group : groups){ JSONObject jsGroup = > group.toJSON(); jsGroup.put("lat", > group.getScope().getCentroid().getY()); jsGroup.put("lng", > group.getScope().getCentroid().getX()); jsGroups.put(jsGroup); } > return jsGroups; } > > -- View this message in context: > http://tapestry.1045711.n5.nabble.com/javascript-and-tapestry-reloading-a-list-tp5713535.html > > Sent from the Tapestry - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/GjqUACgkQbmZsMyUPuXTNAACcCVZBNHE1po9sRbfWYuTjPGSk wIwAoKVaxS3luz2neOdQ4po0VhJFhXcC =WqOz -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org