Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2579 in a recent build.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    82
    Vote Rating
    2
    sencha-noob is on a distinguished road

      0  

    Default Problem passing config to autocreated objects in controller

    Problem passing config to autocreated objects in controller


    REQUIRED INFORMATION
    Ext version tested:
    • Sencha Touch 2.0.0 commercial
    Browser versions tested against:
    • Chrome 19.0.1077.3 dev
    DOCTYPE tested against:
    • html
    Description:Steps to reproduce the problem:
    1. Create a view (pageone) with at least one blank config attribute (bug: null),
    2. Create a reference to that view in a controller. Configure with autocreate: true & xtype.
    3. Create a route that calls a method to show that view
    4. In the controller's show view method, call the ref getter with a custom config - getPageone({bug: 'maybe'});
    5. Before leaving controller's show method, check new pageone's bug attribute - v.getBug()
    6. Show the view;
    7. Switch to a new view & destroy the pageone view explicitly
    8. Return to the page one route; this time the controller's show pageone method should pass a different config - v = getPageone({bug: 'definitely'})
    9. Before leaving controller, check new pageone's bug attribute - v.getBug()
    The result that was expected:
    • I expected that v.getBug() in steps 5 & 9 would differ, since two different config objects were passed in and the first object was explicitly destroyed
    The result that occurs instead:
    • The value of v.getBug() in steps 5 & 9 were both 'maybe', the value of the initial config
    • Since the first config file worked - bug was set to null in the object definition - it seems that passing config's to autocreated objects should work
    • But even after destroying the first object, the second config didn't appear to have any effect on the second instantiation.
    Code Snippet below should demonstrate the problem


    Complete example app attached;
    Code:
      refs: {
        ...
        pageOne: {
          selector: "pageone",
          xtype: "pageone",
          autoCreate: true
        },
    
        ...
      },  
      ...
    },
    
    showPageOne: function() {
      var config;
      if(this.getCount() === 0) {
        config = {bug: 'maybe'};
        this.setCount(1);
        old = false;
      } else {
        config = {bug: 'definitely'};
        old = page;
        page = null;          // sanity check
      } 
      
      page = this.getPageOne(config);   // Global to check objects differ on second this.getPageOne() call
      if(old) {
        console.info(page == old);      // false because it's destroyed in this.showPageTwo()
        console.info(old.getBug());     // Expect original custom config "maybe"; as expected
      } 
      console.info(page.getBug());      // Expect second custom config "definitely"; was "maybe" instead
      console.info(config);         // Custom config object is {bug: 'definitely'} on 2nd pass
      
      Ext.Viewport.setActiveItem(page);
    },
    
    showPageTwo: function() {
      var p = this.getPageOne();
      // Ext.Viewport.remove(p, true);
      p.destroy();            // Explicitly destroying to ensure the same view is not used more than 1x
                              // Removing the destroy call causes the page == old test above to switch to true
      Ext.Viewport.setActiveItem(this.getPageTwo());
    }
    Attached Files

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    21
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    82
    Vote Rating
    2
    sencha-noob is on a distinguished road

      0  

    Default


    One other detail I forgot - I did try adding a constructor that called initConfig(), but that was throwing errors when autocreated with a config, so there isn't one in the example.

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    82
    Vote Rating
    2
    sencha-noob is on a distinguished road

      0  

    Default


    Any progress on this one?

    Any chance of a fix in 2.0.1?

    Thank you

  5. #5
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Hmm looks like it's because of the way Ext.Function.pass appends arguments each time the function is called, instead of replacing them. Can you try adding this override to the top of your app.js and let me know if it gives you the correct outcome:

    Code:
    Ext.require('Ext.app.Controller', function() {
        Ext.app.Controller.override({
    
    
            /**
             * @private
             * 1.x-inspired ref implementation
             */
            ref: function(refs) {
                var me = this,
                    refName, getterName, selector, info;
    
    
                for (refName in refs) {
                    selector = refs[refName];
                    getterName = "get" + Ext.String.capitalize(refName);
    
    
                    if (!this[getterName]) {
                        if (Ext.isString(refs[refName])) {
                            info = {
                                ref: refName,
                                selector: selector
                            };
                        } else {
                            info = refs[refName];
                        }
    
    
                        this[getterName] = function(refName, info) {
                            var args = [refName, info];
    
    
                            return function() {
                                return me.getRef.apply(me, args.concat.apply(args, arguments));
                            };
                        }(refName, info);
                    }
    
    
                    this.references = this.references || [];
                    this.references.push(refName.toLowerCase());
                }
            }
        });
    });
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    I am assuming that Ed's patch fixes the issue and adding it to the next release. Let me know if this didn't actually solve your problem (testing the code I'm pretty sure it does).

  7. #7
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Quote Originally Posted by TommyMaintz View Post
    I am assuming that Ed's patch fixes the issue and adding it to the next release. Let me know if this didn't actually solve your problem (testing the code I'm pretty sure it does).
    My patches and code always sometimes work flawlessly
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer