Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext GWT Premium Member
    Join Date
    Apr 2009
    Location
    NYC
    Posts
    112
    Vote Rating
    1
    stan229 is on a distinguished road

      0  

    Default hasOne Model Assocations Missing

    hasOne Model Assocations Missing


    REQUIRED INFORMATION


    Ext version tested:
    • Sencha Touch 2.0 PR1


    Browser versions tested against:
    • Chrome 15


    Description:
    • Following the Association documentation, I tried to add a hasOne association to my User model (Company). It did not populate the nested data and did not create the getters/setters for the association


    Steps to reproduce the problem:
    • Load User object
    • Check if getCompany() returns anything


    The result that was expected:
    • Company would have data.
      currUser.raw.company

      Object
      . class: "com.breakpoint.Company"
      . companyLogo: null
      . companyName: "Breakpoint Brokerage"
      . contactAddress: "5 Main St, Brooklyn, NY 11229"
      . contactPhone: "7185551212"
      . dateCreated: "2011-11-01T01:24:04Z"
      . endDate: "2011-12-30T05:00:00Z"
      . id: 1
      . isActive: true
      . lastUpdated: "2011-11-01T01:24:04Z"
      . numAccounts: 2
      . startDate: "2011-11-01T01:24:04Z"
      . users: null
      . __proto__: Object


    The result that occurs instead:
    • TypeError: Object [object Object] has no method 'getCompany'


    Test Case:

    Code:
    //User.js
    Ext.define('SuperQualifier.model.User', {
        extend : 'Ext.data.Model',
        fields : [{
            name : "id",
            type : "int"
        }, {
            name : "userName",
            type : "string"
        }, {
            name : "email",
            type : "string"
        }, {
            name : "isAdmin",
            type : "boolean"
        }, {
            name : "passwordReset",
            type : "boolean"
        }],
        // assocations not implemented?
        associations : {
            type : "hasOne",
            model : "SuperQualifier.model.Company"
        },
        proxy: {
            type:"rest",
            url:'../user/getUser',
            reader: {
                type: 'json',
                root: ''
            }
        }
    })
    
    Ext.create('Ext.data.Store', {
        model: 'SuperQualifier.model.User'
    });
    
    //Company.js
    Ext.define('SuperQualifier.model.Company', {
        extend : 'Ext.data.Model',
        fields : [{
            name : "id",
            type : "int"
        }, {
            name : "companyName",
            type : "string"
        }]
    })
    
    //Console Code
    SuperQualifier.model.User.load(1,{success: function(user) { currUser = user }})
    currUser.getCompany()
    
    TypeError: Object [object Object] has no method 'getCompany'


    HELPFUL INFORMATION


    Debugging already done:
    • none


    Possible fix:
    • not provided


    Additional CSS used:
    • only default ext-all.css


    Operating System:
    • Mac OSX 10.7.1

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    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


    Indeed, known issue that is on our plate to fix before release. Thank you for the report.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    5
    Vote Rating
    0
    sebfie is on a distinguished road

      0  

    Default


    I have this issue. How can i fix it?

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi