Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-4261 in a recent build.
  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    25
    Vote Rating
    1
    BigSeanDawg is on a distinguished road

      0  

    Default Ext4 sandbox auto generated id conflict with Ext3

    Ext4 sandbox auto generated id conflict with Ext3


    Hi there,

    I was getting extremely strange issues using ext-all-sandbox.js during development, and finally traced it down to an auto-generated id conflict with Ext3.

    I had "ext-comp-1013" being generated twice.

    Digging through the Ext4 code, it looks like Ext.AbstractComponent.AUTO_ID starts at 1000, and there is nothing to prevent conflicts with ids generated in Ext3.

    As a workaround, I can do any of the following:
    • Define an id explicitly
    • Override and start the AUTO_ID at 100000 (or something sufficiently large enough to probably never create a conflict)
    • Override the default prefix of "ext-comp" with "ext4-comp"
    I like the last the best, but unfortunately I have to override some whole methods (I can't just change the default prefix).

    Any thoughts? Can we get this into Ext 4.0.7?

    Thanks!

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,008
    Vote Rating
    650
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    25
    Vote Rating
    1
    BigSeanDawg is on a distinguished road

      0  

    Default


    The thread that you linked to shows this issue as fixed, but I have Ext 4.0.6 (downloaded today) and I'm seeing this issue. Perhaps this issue was reopened?

    EDIT: I noticed the other issue is referring to "ext-gen", but I'm seeing this for "ext-comp" with ids generated in Ext.Components. Perhaps this issue wasn't addressed in the associated fix?

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,008
    Vote Rating
    650
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I don't see this in 4.0.6. In the sandbox example I can only see a single ext-comp component and it looks like it was created by the 3.x code.

    How can I reproduce it?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    25
    Vote Rating
    1
    BigSeanDawg is on a distinguished road

      0  

    Default


    With Ext 3.3.1 and Ext 4.0.6 sandbox, the following code can expose the issue in the Firebug console:
    Code:
          <script type = "text/javascript">
              Ext4.define('MyApp.MyComp', {
                  extend: 'Ext4.Component'
              });
              
            Ext4.onReady(function() {
                // Ext3 Window
                var w3 = new Ext.Window({
                    title: 'Ext 3.0',
                    autoShow: true,
                    width: 400,
                    height: 400,
                    x: 0,
                    y: 0
                });
                console.log("Ext3 Window id: " + w3.id);
                
                //Ext4 Window
                var w4 = Ext4.create('Ext4.window.Window', {
                    title: 'Ext 4.0',
                    autoShow: true,
                    width: 400,
                    height: 400,
                    x: 425,
                    y: 0,
                    layout: 'fit',
                    items: Ext4.create('MyApp.MyComp', {
                        title: 'Sample Ext4 Test Panel',
                        html: 'Sample Ext4 Test Panel'
                    })
                });
                console.log("Ext4 Window id: " + w4.id);
                
                var c;
                
                //Add 50 components to Ext3
                for (var i=1; i<=50; i++) {
                    c = Ext.create({
                        xtype: 'component',
                        html: 'Ext3 Component ' + i
                    });
                    w3.add(c);
                    console.log("Ext3 Comp id: " + c.id);
                }
                
                //Add one Ext4 
                c = Ext4.create('MyApp.MyComp', {
                    html: 'Ext4 Component ' + i
                });
                w4.add(c);
                console.log("Ext4 Comp id: " + c.id);
            });
            
          </script>
    In the console, you will see 50 generated "Ext3 Comp id: ext-comp-####" logs, and one "Ext4 Comp id: ext-comp-####". The Ext4 id will match one of the Ext3 ids, meaning the ids can conflict.

Thread Participants: 1

Tags for this Thread