-
5 Jul 2011 10:47 AM #221
Ext.Direct v2.0.50727
Ext.Direct v2.0.50727
Good afternoon,
I am using the above version of the Ext.Direct Router with ExtJS 4.0 and am having problems with the following
This is initiated from a model.save on the client sideCode:"{\"action\":\"AppPreferencesActionImpl\",\"method\":\"updateAppPreferences\",\"data\":[{\"reviewDateRangeID\":2,\"requireSufficientFunds\":0}],\"type\":\"rpc\",\"tid\":2}"
The problem is that the data
is being converted to a dynamic object when the request is being deserialized in theCode:\"data\": [{\"reviewDateRangeID\":2,\"requireSufficientFunds\":0}]
however the direct action is expecting the RAW JSON stringCode:DirectProcessorImpl
Now we have verified that the existing code works if we wrap the data element with quotes, such asCode:{\"reviewDateRangeID\":2,\"requireSufficientFunds\":0}
Is this a known issue with ExtJS 4.0 and the older versions of the library - if so I am assuming that the newer versions have addressed this issue.Code:\"data\": ["{\"reviewDateRangeID\":2,\"requireSufficientFunds\":0}"]
Now we are supporting both ExtJS 3.x and ExtJS 4.0 in the same application - until such a time as when the entire application gets converted - are the new Ext.Direct 4.0 libraries backwards compatible with ExtJS 3.x clients.
Please advise!!!
Whatty
-
11 Aug 2011 2:11 PM #222
Hi everybody, I am newcomer in Ext Direct. How can I receive data like in chat - after clicking on button the typed text will be sent for all pages of my asp net application in every opened tab.
Here is my JS file:
and here is my c# class:Code:Ext.onReady(function () { Ext.ns('Ext.ss'); Ext.ss.APIDesc= { "url": "Router.cs", "namespace": "MyApp", "type": "remoting", "actions": { "MyClass": [ { "name": "GetString", "len": 1 }] } }; Ext.QuickTips.init(); var form = new Ext.form.FormPanel({ renderTo: 'container', hideLabels: true, bodyStyle: 'padding: 20px;', width: 400, height: 150, items: { itemId: 'input', xtype: 'textfield', value: '123' }, buttons: [{ text: 'send', handler: function () { var text = form.getComponent('input').getValue(); MyApp.MyClass.GetString(text, function (data) { form.getComponent('input').setValue(data); }); } }] }); });
And I also need help with configuration of my router... It should be realized as http handler? I don't need a stack, I need simple example using 1 server method. THX)Code:using System; namespace MyApp { public class MyClass { public String GetString(String s) { return s+" after server-side"; } } }
-
30 Aug 2011 8:08 AM #223
I use store in ExtJS 4.
I added two records, and then synchronize.
The post data:
The result:Code:{ "action":"Product", "method":"Add", "data":[ [ { "ProductID":0, "ProductName":"Computer", "SupplierID":1, "CategoryID":1, "QuantityPerUnit":"", "UnitPrice":3000, "UnitsInStock":10, "UnitsOnOrder":10, "ReorderLevel":0, "Discontinued":false }, { "ProductID":0, "ProductName":"Computer", "SupplierID":1, "CategoryID":1, "QuantityPerUnit":"", "UnitPrice":3000, "UnitsInStock":10, "UnitsOnOrder":10, "ReorderLevel":0, "Discontinued":false } ] ], "type":"rpc", "tid":2 }
The Store Config:Code:[ { "type":"exception", "tid":2, "action":"Product", "method":"Add", "message":"Parameters length does not match" } ]
Code:var store=Ext.create(Ext.data.Store,{ model:'Products', autoLoad:true, pageSize:20, remoteFilter:true, remoteSort:true, storeId:"ProductStore", proxy:{ type:"direct", //directFn:Ext.app.Product.List1, api:{ read:Ext.app.Product.List, create:Ext.app.Product.Add, update:Ext.app.Product.Edit, destroy:Ext.app.Product.Delete }, reader:{ type:"json", root:"data" }, writer:{ type:"json", //allowSingle:false } } })
-
1 Feb 2012 4:41 PM #224
Ext.Direct support for polling
Ext.Direct support for polling
Good evening,
Does the Ext.Direct stack provide support for polling?
Whatty
-
2 Feb 2012 1:24 AM #225
Hi,
Not really what Ext.Direct is all about, or indeed Ajax; the idea is that it makes server-side methods appear as they are on the client-side, handling all the comms and callbacks for you.
You could always write something that polled an Ext.Direct method on the client-side, kinda, but it's not very web2.0/ajaxy is it?
Cheers,
WestyProduct Architect
Altus Ltd.
-
3 Feb 2012 12:27 AM #226
-
3 Feb 2012 7:33 AM #227
Oh yeah, forgot about that provider
Product Architect
Altus Ltd.
-
3 Feb 2012 11:12 AM #228
Catch Direct Exception
Catch Direct Exception
Hi, all!!! I'm a newbie with ExtJS 4...
I have a tree store loading data from a database and would like to catch an exception if the there is an error loading the data, or if the asp.net session has expired. Below is my code.
Javascript:
Code:var store = Ext.create('Ext.data.TreeStore', { autoLoad : true, model : 'DisabledTreePanelNode', root : { expanded : true }, proxy : { type : 'direct', directFn : _User.Load_TreeItem, listeners : { exception : function(proxy, response, operation) { Ext.MessageBox.show( { title : 'REMOTE EXCEPTION', msg : operation.getError(), icon : Ext.MessageBox.ERROR, buttons : Ext.Msg.OK }); } } }, listeners : { beforeload : function(s, operation, eOpts) { desktop.setSystemStatus('Loading menu item options...', 'icon-loading'); }, load : function(store, node, records, success, eOpts) { if (success) { desktop.setSystemStatus('Ready...', 'icon-accept'); } else { desktop.setSystemStatus('An error occured while trying to menu item options...', 'icon-error'); Ext.MessageBox.show( { title : 'REMOTE EXCEPTION', msg : 'An error occured while trying to menu item options...', icon : Ext.MessageBox.ERROR, buttons : Ext.Msg.OK }); } } } });I'm getting stuck at trying to get the message "Session has expired. Login again" on the javascript side.Code:<DirectMethod()> _ Public Function Load_TreeItem() As NodeCollection ' NodeSerializer 'ByVal order As String, ByVal direction As String) As UserSerializer 'Dim userList As JArray = New JArray() Dim sm As SessionManager = SessionManager.getInstance() Dim objS As ISession = CType(sm.getSession(ClaimCatch_Main.AppHandler.stridSession), ISession) objS = Nothing 'set the session object to nothing If objS Is Nothing Then Throw New Exception("Session has expired. Login again") 'send this message as exception message. THIS ISN'T WORKING. End If Return New NodeCollection() End Function
Any help would be appreciated.
-
14 Feb 2012 4:13 AM #229
Ext.Direct .NET Router
Ext.Direct .NET Router
Anyone have answer to my question.
-
14 Feb 2012 5:17 AM #230
Try overriding the direct proxy, and adding some logic to afterRequest.
e.g.
That's what I do, since with event handlers, other handlers can stop them propagating, or if someone downstream adds them in the same way (i.e. in the config as you're doing) then they get overwritten...Code:Ext.define('Foo.data.proxy.Direct', { extend: 'Ext.data.proxy.Direct', alias: 'proxy.foo-direct', /** * Displays an error if the request failed. * @param {Object} request The Request object. * @param {Boolean} success True if the request was successful. */ afterRequest: function(request, success) { if (!success && request.operation.hasException()) { Ext.Msg.show({ title: 'Error', msg: request.operation.getError(), buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.ERROR }); } } });
I seem to remember a bug I raised to do with the events not getting properly raised.
Another thought, can you see your exception coming back in Firebug?
Cheers,
WestyProduct Architect
Altus Ltd.


Reply With Quote
