-
11 Aug 2011 4:49 AM #401
@Henrik:
Try setting it here where it should get passed on thru your proxy:
Code:,listeners: { beforeload: { fn:function(store, options) { options.params.filterId1 = pxGetExtValueDelayed(panelId + "EHXXID", 1000); options.params.filterId2 = pxGetExtValueDelayed(panelId + "EHXJID", 1000); options.async = false; } }"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.
-
12 Aug 2011 3:31 AM #402
@hendricd
I have tried both you solution and also to add a queue, but I think that the problem is in this extension because of the statement "this.store.load()". I have also tried to add a this.store.async = false; but that had no effect.
Code:/** * When combo box is used on a form with dynamic store (remote mode) * then sometimes the combobox store would load after the form data. * And in that case the setValue method of combobox will not * set the combobox value properly. This override makes sure that the * combobox store is completely loaded before calling the setValue method. */ Ext.override(Ext.form.ComboBox, { setValue : function(v){ var text = v; if(this.valueField){ if(!Ext.isDefined(this.store.totalLength)){ this.store.on('load', this.setValue.createDelegate(this, arguments), null, {single: true}); if(this.store.lastOptions === null){ var params; if(this.valueParam){ params = {}; params[this.valueParam] = v; }else{ var q = this.allQuery; this.lastQuery = q; this.store.setBaseParam(this.queryParam, q); params = this.getParams(q); } this.store.load({params: params}); } return; } var r = this.findRecord(this.valueField, v); if(r){ text = r.data[this.displayField]; }else if(this.valueNotFoundText !== undefined){ text = this.valueNotFoundText; } } this.lastSelectionText = text; if(this.hiddenField){ this.hiddenField.value = v; } Ext.form.ComboBox.superclass.setValue.call(this, text); this.value = v; } });
-
12 Aug 2011 4:45 AM #403
@Henrik-
The base-x extensions are Adapter extensions for Ext.lib.Ajax.
It does NOT (WILL NEVER) provide all the necessary overrides to the various data.Readers, data.Proxies, and data.Stores to support synchronous requests because Synchronous Ajax requests degrade the user experience - blocking the ONLY (single) thread of execution available to your page until the request either succeeds, fails, or worse : times-out.
Rethink your approach to the problem a bit more. Use the various events available to you throughout the framework to solve problems like these. There are only one or two scenarios where I would EVER justify a synchronous request."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.
-
12 Aug 2011 10:29 AM #404
@Doug
Thank you for your help and advice, unfortunately this is one of the cases where it is necessary to have the process done procedural. I have 3 combos where the value in the first has to go into the second and third, and the value in the second has to go into the third.
When the form is initial rendered the controller renders a generic form view object that are passed by the server and ask a service on the server for the initial values of the fields that are pass back as a JSON object. On the server a number of REST services resides that either passes a single JSON row object or a selection of rows to the remote combo boxes in the UI. All works fine besides the initial load.
You may ask why I just don’t pass the whole table to the UI but table 1 may be 1,000 rows, table 2 may be 10,000 rows and table 3 may be 200,000 rows. First it would be extremely time consuming in server time, in transfer time and in selection time in the Ext JS to handle the amount of data secondly the selection has to be done based on tables that may be very dynamic because the tables may be part of a ERP solution with very large database tables that may constantly changes.
There may of course be a way to access the values from the JSON row object that is associated with the form (that by the way also is loaded with a server call with async : false) but that goes beyond my expertise mainly because the form controller is a generic controller that hasn’t got a clue of neither design (view) of the form it handles nor the JSON row objects it receives that is all done on the server side to avoid monolithic controllers (and the same goes for grids).
IMHO there is many areas in a ERP UI where the user has to wait on the answer from the server that even in a MVC/SOA environment hasn’t to be long … if you sell shoes and also accessories entering an item number may require a quantity, but if it is a shoe it also requires a size and maybe a color. And in a high volume data entry app, you will be caught between the efficiency of a character based interactive UI, that are able to change the form / dialog in a MS, against the more “nice looking” but more inefficient “Windows Like” UI.
Making the decision if and when the UI requires a “wait” before the user proceeds (async: false/true is a standard feature of AJAX) is to me up to the system designer and leaving the feature out in any framework is crippling the system designers possibility to create UI that may be beyond the frameworks developers imagination – and to be frank, it doesn’t give any meaning to me to make a AJAX implementation that basically runs on either W3C or ActiveX without the upper layers inherited and supports the basic functionality in AJAX – it is basically only one parameter that has to be passed with many others – not a big dice – the functionality should be there as standard – we can the take a technical discussion when or when not it should be used.
And in fact, what you see in my last posting is a Sencha UX that really is a work around (originally made by animal and condor I think) about the problem that when rendering text in a remote combo you are not able to do or controle the underlying AJAX call (or it is never made) – the store isn’t just loaded before the rendering of the select value is done – apparently nobody at Sencha has thought that maybe a remote combo would have an initial value and should ask the server for the appropriate selection value.
Regards,
Henrik
-
13 Aug 2011 2:27 PM #405
-
19 Aug 2011 2:43 PM #406
@Doug
Any plans to port the ext-basex extension to ExtJS 4?
-
22 Aug 2011 4:49 AM #407
"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.
-
25 Apr 2012 4:25 AM #408
Hi, Doug!
Looks like Firefox 12 has broken async: false Ajax request option.
The request doesn't even gets initialized.
I'd really appreciate any feedback on the issue.
I use 4.1.1 + Extjs 2
Thanks!
-
25 Apr 2012 6:45 AM #409
Hi,
Hi,
I have exactly the same problem with Firefox 12: broken if async=false

Any help would be precious.
Jhashe
-
26 Apr 2012 12:11 AM #410
I founded a work around for FF12, but I don't know which consequences it could have.
In ext-basex.js, function makeRequest, there is a code :
If I comment the lineCode://IE8/other? evolving timeout callback support if(callback && callback.timeout){ ('timeout' in r) && (r.timeout = callback.timeout); ('ontimeout' in r) && (r.ontimeout = this.abort.createDelegate(this, [o, callback, true], 0)); ('ontimeout' in r) || // Timers for syncro calls won't work here, as it's a blocking call (options.async && (this.timeout[o.tId] = window.setInterval( function() {A.abort(o, callback, true); }, callback.timeout))); }in this bloc (line 1010 in v4.0), requests run fine on FF12. But be carreful, I don't know what I "desactive" in the libraryCode:('timeout' in r) && (r.timeout = callback.timeout);





Reply With Quote