-
24 Feb 2010 10:18 AM #131
-
24 Feb 2010 11:21 AM #132
Great work! I was able to seamlessly replace the version I had hacked away at to make it work for my needs with this new version and it worked perfectly. I'm happy to be using the pseudo-official version of the .NET router now.
-
24 Feb 2010 12:14 PM #133
@Evan, I receive an js error in IE (Id, string or number is expected) when opening the Grid and Form examples. However, the examples do work in Mozilla Firefox. I'm running the examples with the Visual Studio .NET web server.
Anyone else having this problem?
UPDATE: For IE, you need to remove the comma after 'direction: 'ASC',' in all js files in the Grid directory and the comma after 'company: 'Ext',' in the form.js file in the Form directory. (Big up to myself
)
Thanks!
-
24 Feb 2010 4:22 PM #134
Ah, duh. Didn't test it on IE. I'll fix this up.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
24 Feb 2010 4:34 PM #135
Thanks guys, got it updated.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
24 Feb 2010 8:01 PM #136
how to Get Object value with ParamsAsHash
how to Get Object value with ParamsAsHash
Firebug Infomation:
SERVER MethodCode:{"action":"Method","method":"GetTrees","data":["0",{"param1":"value1","param2":"value2"}],"type":"rpc" ,"tid":2}
please tell me how to do!Thanks!Code:[DirectMethod] public JArray GetTrees(string ID,Object obj) { //HOW TO GET obj's Values }
-
24 Feb 2010 8:10 PM #137
By default it parses it as a dictionary, check it out using the debugger.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
17 Mar 2010 1:53 PM #138
Aspect Oriented Functionality
Aspect Oriented Functionality
I have been trying out your implementation and I generally like it. I have two questions/feature requests. (I will do them myself if needed).
1) [Minor]
---------------------------
Add an id to the provider to simplify JS access to the provider.
In JavaScript It would be nice to be able to do:
I have been adding the id myself, quick and dirty like so:Code:Ext.Direct.getProvider(id);
Likely place to implement it is:Code:Namespace.To.Handler.id = "Namespace.To.Handler"; Ext.Direct.addProvider(Namespace.To.Handler);
2) [Major]Code://Ext.Direct.DirectHandler::ProcessRequest provider = new DirectProvider() { Name = this.ProviderName, Url = context.Request.Path, Namespace = this.Namespace, Timeout = this.Timeout, MaxRetries = this.MaxRetries, AutoNamespace = this.AutoNamespace, ID = this.GenerateID(); // or something similar. <------- };
---------------------------
Add the ability to inject/autoprocess/overwrite meta data along with the requests. Let me try to explain without the meta data injection, then the proposed solution with the injection. (this example is a bit contrived for demonstration purposes)
Assume I have method:
This method simple returns the name of the current view for a particular browser window instance(same session). The client calls this from JS using its direct provider and passes in some guid that it created when the page was first loaded. This allows the user to have multiple pages open within the same session but render different results.Code:GetCurrentView(Guid clientInstanceToken);
In the current architecture, one simply has to add the clientInstanceToken to every method to make this work. I would like to have the ability to add this functionality "behind the scenes"; that is, inject the parameter clientInstanceToken to all methods with (perhaps) the MetaDataParameterAttribute("clientInstanceToken") like so:
orCode:[DirectMethod,MetaDataParameterAttribute("clientInstanceToken")] public string GetCurrentView(Guid clientInstanceToken);
Then the direct provider can add the new metadata parameter to the Ext.Provider instance it creates along with a mechanism to retrieve its value. This could be a simple function in JS that the consumer must process:Code:[DirectMethod,MetaDataParameterAttribute("clientInstanceToken")] public string GetCurrentView();
There are many ways to "present" the meta data to the DirectAction instance, here are a few quick ideas:Code:Ext.Direct.getProvider(id).acquireMetaData = function(args){ //return the metadata here; }
1) If the parameter "clientInstanceToken" exists, then simply populate it with the value.
2) If the parameter does not exist, have a dictionary in the DirectHandler that contains the metadata values for the current request:
With this type of functionality, any method could contain meta-information that can be applied in an aspect oriented way. Which makes security, identification, concurrency, etc much simpler to implement.Code:base.MethodMetaData["GetCurrentView"]
Let me know what you think, I will likely be integrating these ideas sometime next for my next project, so hopefully I hear something before then!
-
17 Mar 2010 7:00 PM #139
1) Easy enough, sure.
2) Interesting idea. The problem is that I can't just implement it in the .NET router. It would actually require changes to the framework to allow the acquisition of the meta data.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
18 Mar 2010 8:51 AM #140
I agree that some injection/non-supported code would be required for it to work on the client side. (therefore the feature would be tied to specific versions of Ext) But all in all, it can be done without touching the Ext libraries and would only need to be updated if the Ext.Direct plumbing changed. We don't need to add additional features, we only need to inject parameters before its sent to the server, then strip those back out before presenting it to .NET.
In fact, I have a working example of the client side fully functional without the .NET portion. I simply respond to the "beforecall" event and add the metadata parameters there. It currently works fine with or without the parameter specified:
The only issues I found while making this work was the callback was lost when all parameters are not specified. I simply recreated the callback after injecting the proper parameters and all works well.Code:Path.To.GetCurrentView("GUID-VALUE-HERE",function(data, trans) { // Process Results }); Path.To.GetCurrentView(function(data, trans) { // Process Results });





Reply With Quote