Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default [DUPE/FIXED] XDS produces incorrect code for FormPanel and BorderLayout regions.

    [DUPE/FIXED] XDS produces incorrect code for FormPanel and BorderLayout regions.


    (I'm not using XDS myself and I am only reporting this for another user, so correct me if I've missed something)

    The Designer doesn't take into account that BasicForm and BorderLayout.Region are constructed from the initialConfig of the component.

    Example: The following two panels won't use the marked config options, because they are not part the the object's initialConfig.
    Code:
    MyPanelUi = Ext.extend(Ext.Panel, {
        title: 'My Panel',
        region: 'west',
        width: 200,
        split: true,
        initComponent: function() {
            MyPanelUi.superclass.initComponent.call(this);
        }
    });
    MyFormUi = Ext.extend(Ext.form.FormPanel, {
        title: 'My Form',
        layout: 'form',
        standardSubmit: true,
        url: 'myurl.html',
        initComponent: function() {
            MyFormUi.superclass.initComponent.call(this);
        }
    });

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I read that the next maintenaince release already fixes the BasicForm problem. Does it also fix the BorderLayout.Region problem?

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I did a quick scan of the Ext code and initialConfig is used by a lot more components than I thought.

    AnchorLayout
    BorderLayout
    ToolbarLayout
    ComboBox
    SliderField
    GridView
    FormPanel
    and some other components that you can't define in XDS.

  4. #4
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    Hey Condor,

    Yes all of the configurations for components that are read from initialConfig are going to be applied to a config object and passed into a constructor, rather than set directly on the prototype or set within initComponent.

    The change to, for example the FormPanels, will look like this:

    Code:
    MyFormUi = Ext.extend(Ext.form.FormPanel, {
        title: 'My Form',
        layout: 'form',
        constructor: function(config){
            MyFormUi.superclass.constructor.call(this, Ext.apply(config || {}, {
                standardSubmit: true,
                url: 'myurl.html'
            }));
        },
        initComponent: function() {
            MyFormUi.superclass.initComponent.call(this);
        }
    });
    Since they will be passed into the constructor as a part of the config object, they will be set to the initialConfig object in Ext.Component.constructor.

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    No, that's wrong. It should be:
    Code:
    MyFormUi.superclass.constructor.call(this, Ext.apply({
        standardSubmit: true,
        url: 'myurl.html'
    }, config));
    1. You should not modify the config object (it could be reused to create more objects).
    2. You should be able to override the default options with the config object.

    ps. Which properties do you currently have marked as being required in the constructor?

  6. #6
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    Yes I know, I just typed it up wrong but that's what I'm doing. It will be the same as the Store generated code:

    Code:
    MyStore = Ext.extend(Ext.data.JsonStore, {
        constructor: function(cfg) {
            cfg = cfg || {};
            MyStore.superclass.constructor.call(this, Ext.apply({
                storeId: 'MyStore'
            }, cfg));
        }
    });
    Which properties? All that are read from initialConfig of course. In the case of FormPanel, all that belong to BasicForm.

  7. #7
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Quote Originally Posted by jarrednicholls View Post
    Which properties? All that are read from initialConfig of course. In the case of FormPanel, all that belong to BasicForm.
    Did you scan the entire Ext codebase? (e.g. do you set 'width' in the constructor when a component is in an AnchorLayout?).

Similar Threads

  1. Replies: 1
    Last Post: 5 Mar 2009, 11:52 AM
  2. Defining regions in BorderLayout
    By gogofe in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 24 Aug 2008, 7:30 AM
  3. Replies: 2
    Last Post: 2 May 2008, 12:23 PM
  4. Fixed Width (Non-Resizable) East/West Regions in a BorderLayout
    By krogers in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 7 Feb 2008, 6:28 PM

Thread Participants: 1