Re: Updating a page with a JSONObject

2011-01-13 Thread Taha Hafeez
public class SomePage { @Inject private ComponentResources resources; @Inject private JavaScriptSupport javaScriptSupport; void afterRender(){ //Create an event link Link link = resources.createEventLink("update"); javaScriptSupport("yourUpdateFunc('%s')", link.toAbsoluteURI()); } //Ha

Re: Updating a page with a JSONObject

2011-01-13 Thread Mark
>> This lead me to believe that >> I could replace: return new MultiZoneUpdate("totalPriceZone", >> totalPriceZone); > > Not correct. The second parameter should be a component or a block. Zone and > MuitiZoneUpdate are meant to be used without custom written JavaScript. > >> With something like: >

Re: Updating a page with a JSONObject

2011-01-13 Thread Mark
>> With something like: >> return new JSONObject().put("totalPriceZone", getTotalPrice()); >> > In this case a JSONObject is returned to the caller which can be any > javascript and then the object can be > used in any way. If you want to update the zone you have to do it yourself Ok that makes se

Re: Updating a page with a JSONObject

2011-01-13 Thread Thiago H. de Paula Figueiredo
On Thu, 13 Jan 2011 13:24:32 -0200, Mark Shead wrote: The documentation says that the event handler for an Ajax call can return (among other things) a JSONObject. Correct. This lead me to believe that I could replace: return new MultiZoneUpdate("totalPriceZone", totalPriceZone); Not c

Re: Updating a page with a JSONObject

2011-01-13 Thread Taha Hafeez
On Thu, Jan 13, 2011 at 8:54 PM, Mark Shead wrote: > The documentation says that the event handler for an Ajax call can > return (among other things) a JSONObject. This lead me to believe that > I could replace: > return new MultiZoneUpdate("totalPriceZone", totalPriceZone); > > In this case the

Updating a page with a JSONObject

2011-01-13 Thread Mark Shead
The documentation says that the event handler for an Ajax call can return (among other things) a JSONObject. This lead me to believe that I could replace: return new MultiZoneUpdate("totalPriceZone", totalPriceZone); With something like: return new JSONObject().put("totalPriceZone", getTotalPrice(