1. #401
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    @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.


  2. #402
    Sencha User
    Join Date
    Jul 2009
    Posts
    12
    Vote Rating
    0
    Henrik Rutzou is on a distinguished road

      0  

    Default


    @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;
        }
    });

  3. #403
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    @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.


  4. #404
    Sencha User
    Join Date
    Jul 2009
    Posts
    12
    Vote Rating
    0
    Henrik Rutzou is on a distinguished road

      0  

    Default


    @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

  5. #405
    Sencha User
    Join Date
    Aug 2010
    Posts
    34
    Vote Rating
    0
    aratcliffe is on a distinguished road

      0  

    Default


    Thanks Doug, that's very cool!!

  6. #406
    Ext JS Premium Member sumit.madan's Avatar
    Join Date
    May 2009
    Location
    Bangalore, India
    Posts
    121
    Vote Rating
    24
    sumit.madan has a spectacular aura about sumit.madan has a spectacular aura about

      0  

    Default


    @Doug

    Any plans to port the ext-basex extension to ExtJS 4?

  7. #407
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Yes,

    ManagedIframe 4 alpha2 for Ext 4 is available here.
    "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. #408
    Ext JS Premium Member
    Join Date
    Jul 2007
    Posts
    218
    Vote Rating
    2
    ZooKeeper is on a distinguished road

      0  

    Lightbulb


    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!

  9. #409
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
    jhashe is on a distinguished road

      0  

    Default Hi,

    Hi,


    I have exactly the same problem with Firefox 12: broken if async=false
    Any help would be precious.

    Jhashe

  10. #410
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
    jhashe is on a distinguished road

      0  

    Default


    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 :

    Code:
    //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)));
                        }
    If I comment the line
    Code:
    ('timeout' in r) && (r.timeout = 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 library

Thread Participants: 82

  1. galdaka (1 Post)
  2. Digital God (3 Posts)
  3. prophet (1 Post)
  4. alayasf (2 Posts)
  5. tof (1 Post)
  6. stever (3 Posts)
  7. mystix (4 Posts)
  8. fangzhouxing (6 Posts)
  9. ludoo (1 Post)
  10. KRavEN (4 Posts)
  11. DigitalSkyline (3 Posts)
  12. daemach (1 Post)
  13. violinista (1 Post)
  14. mlarese (1 Post)
  15. walker_cn (4 Posts)
  16. stevebla (4 Posts)
  17. Chris in Cambridge (1 Post)
  18. mjlecomte (2 Posts)
  19. ZooKeeper (10 Posts)
  20. brookd (1 Post)
  21. fermo111 (6 Posts)
  22. kevinwu8 (1 Post)
  23. Spirit (3 Posts)
  24. jerrybrown5 (4 Posts)
  25. lvanderree (8 Posts)
  26. Makor (4 Posts)
  27. yanick (1 Post)
  28. wm003 (10 Posts)
  29. radio1 (3 Posts)
  30. jphillips (2 Posts)
  31. markpele (2 Posts)
  32. Romantik (1 Post)
  33. Sander_S (4 Posts)
  34. maximumcoder (2 Posts)
  35. NotChris (6 Posts)
  36. ritchrs (2 Posts)
  37. sksoft (2 Posts)
  38. jvanantwerp (2 Posts)
  39. jfa (2 Posts)
  40. BlueCamel (1 Post)
  41. ClemsonJeeper (3 Posts)
  42. sp797 (1 Post)
  43. mahesh122 (2 Posts)
  44. zombeerose (12 Posts)
  45. jlowe (2 Posts)
  46. bt_bruno (2 Posts)
  47. pompom (4 Posts)
  48. Eric24 (18 Posts)
  49. baumschule (3 Posts)
  50. coderobo (3 Posts)
  51. krause (1 Post)
  52. mubenchi (1 Post)
  53. mrkadakia (3 Posts)
  54. tomim (4 Posts)
  55. canxss (2 Posts)
  56. tasman (3 Posts)
  57. mrsunshine (4 Posts)
  58. Trinad (2 Posts)
  59. jasonb885 (2 Posts)
  60. wki01 (5 Posts)
  61. mschwartz (2 Posts)
  62. sarathy (2 Posts)
  63. jdurante (1 Post)
  64. TomChiverton (1 Post)
  65. sumit.madan (2 Posts)
  66. Riemi (4 Posts)
  67. Henrik Rutzou (3 Posts)
  68. hairinwind (1 Post)
  69. gzlizp (1 Post)
  70. yuanqixun (2 Posts)
  71. larryaubstore (2 Posts)
  72. wupeng (2 Posts)
  73. blueram (1 Post)
  74. ronivcp (1 Post)
  75. t00bs (2 Posts)
  76. hyponym (4 Posts)
  77. mg2468 (3 Posts)
  78. scaddenp (1 Post)
  79. faith wins (3 Posts)
  80. aratcliffe (8 Posts)
  81. jhashe (3 Posts)
  82. jaufgang (1 Post)

Tags for this Thread