-
15 Apr 2010 8:27 PM #1
[Resolved] Facing Problem In Saving A UI Document
[Resolved] Facing Problem In Saving A UI Document
I am trying to save a Notes document using
interviewSession.uidoc.save();
where interviewSession is a variable in which Grid panel is defined.
The Screen Shot of Problem is :
[IMG]file:///C:/DOCUME%7E1/TASKER%7E1.TXP/LOCALS%7E1/Temp/moz-screenshot.png[/IMG]Problem.jpg
On analysing the code throught fire bug the json response is as mentioned below:
Json Response.jpg
This response is not evaluated properly by ext.nd. I tried to update it using $$Return field ... But it didn't helped.
If any one has encountered this problem before, please help me out .
Thanks In Advance
-
29 Apr 2010 9:18 PM #2
I think I have found a solution.
On WebQuerySave an agent is triggered, which returns JSON response like.
Print |Content-Type:text/json|
Print |{"success" : true}|
It overrides the default "Form Processed" response. As mentioned in the screen shot above
-
1 May 2010 10:28 AM #3
Yes, that is correct. For an "Ajax" type save you want the agent to return text/json or application/json as the content type. If you look at the tasks.nsf db that comes with the Ext.nd zip download file you can see an example of an agent that is called that returns application/json as the content type.
Also, since the "default" for Ext.nd.UIDocument is to do an "Ajax" save and not a normal form submit, you need to write a handler to handle success and failure conditions. Remember that success and failure as far as Ext is concerned is determined by the success property returned in the JSON. success : true will call your success handler and success : false will call your failure handler.
Look at the taskUISimple.js to see an example where the .save() method is called but with success and failure handlers defined to handle the response from the server.
-
2 May 2010 7:21 PM #4
-
1 Feb 2012 7:03 AM #5
Hi.
I need to save ext.uidoc and when run some code on server side. Why my 'some code' run before save although save is after in code:
Code:if (this.Ext.nd.currentUIDocument.editMode) { Request.save(); } var resp = GetFromServer('StartAction', actUNID); ... function GetFromServer(actionName, data) { ... xmlHttp.open('GET', sendURL, false); xmlHttp.send (null); ... } ... var Request = function() { return { save : function(bClose) { ... this.uidoc.save({...}) } }(); Ext.onReady(Request.init, Request, true)
Is where any possibility to call directly some like this: this.Ext.nd.currentUIDocument.save() and when continue to run other code?Last edited by jratcliff; 8 Feb 2012 at 8:26 AM. Reason: added code tags to make the code readable
-
8 Feb 2012 8:34 AM #6
This is because the this.uidoc.save() call is Asynchronous. You need to define a success handler in the .save() call and from there, run your other code.
Something like this
Code:if (this.Ext.nd.currentUIDocument.editMode) { Request.save(); } ... function GetFromServer(actionName, data) { ... xmlHttp.open('GET', sendURL, false); xmlHttp.send (null); ... } ... var Request = function() { return { save : function(bClose) { ... this.uidoc.save({ success: function() { var resp = GetFromServer('StartAction', actUNID); }, failure: function() { // do something else } }); } }(); Ext.onReady(Request.init, Request, true)Jack Ratcliff
Sencha Inc, Green bleeding Senchan
How to report a bug:
http://www.sencha.com/forum/showthre...o-report-a-bug


Reply With Quote
