I tried it but is still not working.
But i found something else. I manage to hook the JSONWriterImpl and send
whatever plain text i want to the client.
When i send the string : ({title: 'a new title'}) is working.
When i send the string : {title: 'a new title'} is not working.
So the
I've been looking into TreeRpcControllerV3.js and TreeEditor.js for the
place where the response is handled , but i haven't got any result beside a
headache.. :)
Any suggestion is welcome !
Alex
On 12/17/06, Alexandru Dragomir [EMAIL PROTECTED] wrote:
I tried it but is still not working.
Some good news.
In TreeLoadingControllerV3.js , runRpc , the mimetype is set as
text/javascript.
In method doLoad from BrowserIO.js :
- if mimetype is text/javascript the method dj_eval(http.responseText);
is called
- if mimetype is */json the method dj_eval((+http.responseText+)); is
called
I'd say that this is a bug in the tree controller. Tapestry should
not be sending back any JSON data enclosed with ().
This represents a browser quirck and should be handled in the
appropriate place - the browser. I'd bring it up with dojo, probably
by filing a bug in http://trac.dojotoolkit.org
From what i've seen , the second option is the right one : i'm not returning
what the tree is expecting.
In the begining i thought it was json but now is clear that's , as you said
, javascript content.
I'll check the response builder to see if i can treat this somehow.
On 12/17/06, Jesse
Jesse Kuhnert wrote:
I'd say that this is a bug in the tree controller. Tapestry should
not be sending back any JSON data enclosed with ().
+1
Either the tree is
incorrectly using javascript mimetype when it should be using json or
you aren't returning what the tree is expecting.
Or,
I think it can be handled very well with what is existing already in
framework.
I just took the wrong approach at the begining thinking that is json
response.
I'll post back after some time.
thanks.
Alex
On 12/17/06, andyhot [EMAIL PROTECTED] wrote:
Jesse Kuhnert wrote:
I'd say that this is
Well be careful ...I'm not saying for sure that I know what is the
right approach in this particular instance, but I do know that I don't
like that tree widget at all. It may very well be a bad design
decision on the widget authors part, so just be careful jumping
through too many hoops if you
True.
I overwritten the runRpc from the controller changing to text/json and it
worked smoothly !
Hope i'm not going into other issue doing this :)
thanks !
var controller = dojo.widget.createWidget(TreeRpcControllerV3,{editor:
editorul.widgetId,widgetId: controller,RpcUrl:${url},
I'm working on a component that expects a json response (.. frankly , i'm
not sure anymore about this)
Is a dojo widget that i'm trying to convert into tapestry.
A valid response would be :
({title: a new title})
or even
dojo.debug(server gave a new title); ({title: a new title})
The
Quoting/not quoting a response should have nothing to do with it being
valid JSON. Nor should a response contain the surrounding ( content
).
I'd be interested in knowing which dojo widget this is but if it's
using dojo.io as the transport layer it should be adding in the (
for you.
On
ok, then i might be doing something else wrong..
Is the tree widget.
And now i'm at editing a node label phase.
I edit , press enter , and the response received is {title : a new
title} without other brackets.
The render method is
public void renderComponent(IJSONWriter writer, IRequestCycle
Yes, that should be fine. It is a perfectly valid JSON response. There
aren't too many ways to vary it.
On 12/16/06, Alexandru Dragomir [EMAIL PROTECTED] wrote:
ok, then i might be doing something else wrong..
Is the tree widget.
And now i'm at editing a node label phase.
I edit , press enter ,
Maybe the tree widget is expecting a json array vs object being
returned...Ie [title,a new title]. You can do that easily by doing
this instead:
JSONArray arr = writer.array();
arr.put(title);
arr.put(a new title);
On 12/16/06, Jesse Kuhnert [EMAIL PROTECTED] wrote:
Yes, that should be fine.
14 matches
Mail list logo