Looks like a bug, its supposed to be for the case where the event handler returns null, but it seems like it's getting added in even for event handlers that return a JSONObject.
On Thu, Feb 28, 2008 at 1:03 PM, Sven Homburg <[EMAIL PROTECTED]> wrote: > in class "AjaxComponentEventRequestHandler" the method "handle" > creates an empty JSONObject, i cant checkout why. > > is it a bug or a feature? > > 2008/2/27, Adriaan Joubert <[EMAIL PROTECTED]>: > > > > > > Hi, > > > > I'm having a problem with returning a JSON object from an actionlink > > in (5.0.11-SNAPSHOT). I have some javascript that submits a request, > > which works great, and the actionhandler returns a JSONObject as > > follows > > > > > > Object onUpdate() { > > .... > > JSONObject json = new JSONObject(); > > json.put("fcId", fcId); > > return json; > > } > > > > This works fine, but on the client side I get: > > > > onComplete : function(transport) { > > var response = transport.responseText; > > // if (response.length>2 && response.endsWith("{}")) > > // response = response.substring(0,response.length-2); > > var reply = response.evalJSON(true); > > .... > > } > > > > The responseText contains > > > > {"fcId":36178}{} > > > > If I strip of the additional two braces everything is great and the > > reply is parsed correctly, but I must be doing something wrong. > > prototype.js says that JSON objects are often accessible directly from > > transport.headerJSON, but this is null in my case. Anybody got any > > ideas what I need to do to not have the additional 2 braces? > > > > Thanks, > > > > Adriaan > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > with regards > Sven Homburg > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]