-
14 Jan 2008 4:00 PM #11
Wow -- thanks VERY MUCH from me also hendricd -- your code makes session timeouts a breeze to handle.
In my application, I simply included "ext-basex-min.js" as described above, and then added a single call to Ext.lib.Ajax.onStatus(...) also as described above. This works very great for handling session timeouts reported by my server-side code.
However, please note the following bug and (hopefully sound) fix I implemented. My code is far too large to post here, but I'll describe the problem as best I can.
My application contains a GridPanel populated by a JsonStore. User clicks on other elements on the screen trigger the JsonStore (and therefore the GridPanel) to reload with applicable data from the server. It's very possible for a user to trigger the reloading of the JsonStore before a previous load was completed. This worked fine without the "ext-basex-min.js" in my app, but including that file (without even calling anything in it) caused IE6 & 7 to trigger a JavaScript error in this situation. Firefox still worked fine though.
My fix involves moving a single line of code into an existing try/catch block as indicated in these snippets.
Old:New:Code:createResponseObject:function(o, callbackArg){ var obj = {}; var headerObj = {},headerStr=''; try{ //to catch bad encoding problems here obj.responseText = o.conn.responseText; }catch(e){obj.responseText ='';} obj.responseXML = o.conn.responseXML; try{ headerStr = o.conn.getAllResponseHeaders()||''; } catch(ex){}This seems to meet the need in my app, but maybe there's a better fix?Code:createResponseObject:function(o, callbackArg){ var obj = {}; var headerObj = {},headerStr=''; try{ //to catch bad encoding problems here obj.responseText = o.conn.responseText; }catch(e){obj.responseText ='';} try{ obj.responseXML = o.conn.responseXML; headerStr = o.conn.getAllResponseHeaders()||''; } catch(ex){}
Questions and comments are very welcome!
Thanks again,
-radio1
-
14 Jan 2008 7:16 PM #12
@radio1 -- Thanks for the feedback!
Could you tell me what the exception raised by IE was?
Further, could you post the handler used to call the store.load? Was it called asynchronously?
Was: Ext.lib.Ajax.forceActiveX == true ??
Thanks.
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
15 Jan 2008 10:28 AM #13
The message in IE is the usual "Problems with this Web page might prevent it from being displayed properly....." popup with the following details:
Line: 236
Char: 9
Error: Unspecified error.
Code: 0
URL: 'myurl'
Note that I isolated the cause of the problem to simply including either "ext-basex.js" (or "ext-basex-min.js") via a <script> tag in my source HTML file (even without actually calling Ext.lib.Ajax.onStatus(...) or referencing any other code in your extension), so Ext.lib.Ajax.forceActiveX was untouched.
As for my JsonStore-related code, my code only ever calls JsonStore.reload() (not .load()). Yup, the calls are asynchronous, and the problem occurred when a second ajax request was sent by the JsonStore while a previous request was still outstanding (the first response was not yet fully received).
For posterity, here's a simplified version of my JsonStore instantiation code -- simplified only by shortening the values assigned to the config options (those are all of the config options I use). I also do some screen-only cosmetic stuff in the event handlers shown (no ajax stuff).
Thanks much again -- please let me know if I can be of any further help. Questions and comments are always welcome.Code:jsonDs = new Ext.data.JsonStore({ url:'myurl', baseParams: {cmd:'get'}, root:'items', fields:[...aBunchOfFields...] }); jsonDs.setDefaultSort(...); jsonDs.on("beforeload", onStoreLoading, this); jsonDs.on("datachanged", onStoreChanged, this);
-radio1
-
16 Jan 2008 6:00 AM #14
A supplementary note to my above post -- I tried a couple more tests with your original version of "ext-basex.js". Explicitly setting Ext.lib.Ajax.forceActiveX to either true or false has no impact on the problem I described -- it still occurs in both cases. Note however that in my real application, I do not change its default value.
-radio1
-
16 Jan 2008 6:27 AM #15
Thanks, I'll keep pondering...
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
4 Feb 2008 9:45 PM #16
Second Release adds dynamic javascript load/exec...
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
4 Mar 2008 3:59 PM #17
ext-basex/ux.ModuleManager Rc2 posted.
ext-basex/ux.ModuleManager Rc2 posted.
This release adds internal module caching, styleSheet helpers, and callback support.
Note: A progressive Ext loader sample (dependency-aware) is just about finished; will advise when packaged."be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
8 Mar 2008 8:38 AM #18
ext-basex Updated 2.2
ext-basex Updated 2.2
The update corrects a problem reported with the current ext-base adapter implementation.
When passing postable content (jsonData, xmlData), the Content-Type headers were either duplicated (more than one sent) and/or the default post header value ('application/x-www-form-urlencoded') was being sent in all cases. This update corrects that behaviour when ext-basex is used.
It is now possible to use traditional Observable syntax for setting global httpStatus handlers:
Code:Ext.lib.Ajax.on({ 'status:403' : permissionHandler , 'status:500' : criticalHandler });"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
10 Mar 2008 1:47 AM #19
404 in linux
404 in linux
Hi,
this line(ext-basex.js, line 840):
don't work in OS, which has case sensitive file system(linux for example), it's probably bug.Code:fullModule=(module.indexOf(".")!==-1?module:module+".js").toLowerCase()
-
10 Mar 2008 4:00 AM #20
@yanick -- indeed that would be. Fix posted shortly.
Good eye."be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.


Reply With Quote


