Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    paranella is on a distinguished road

      0  

    Default Error: namespace is undefined

    Error: namespace is undefined


    Designer version tested:
    • Designer 1.2.2 Build 48
    Operating System:
    • Windows 7
    Framework:
    • Ext JS 4.x
    Description:
    • When I link a class into another class I get "namespace undefined" error
    Steps to reproduce the problem:
    • Create a form panel
    • Create a window
    • Link panel into the window
    • Export your code and execute your application
    The result that was expected:
    • the window showing with the inner panel
    The result that occurs instead:
    • javascript error: namespace is undefined
    Possible fix:
    • insert alias property into the ui class with magic word 'widget'
      Code:
      Ext.define('MyApp.view.ui.MyForm', {
          extend: 'Ext.form.Panel',
          alias: 'widget.myform',
          .....

  2. #2
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,924
    Vote Rating
    63
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    I tried what you suggested and it did produce alias: widget.myform but it did so in MyApp.view.MyForm and not the base class

    Code:
    Ext.define('MyApp.view.MyForm', {
        extend: 'MyApp.view.ui.MyForm',
        alias: 'widget.myform',
    
        initComponent: function() {
            var me = this;
            me.callParent(arguments);
        }
    });
    Last edited by Phil.Strong; 20 Dec 2011 at 11:41 AM. Reason: typo
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    paranella is on a distinguished road

      0  

    Default


    Ok Phil,

    but what appen if you have exported code before linking? external ui files are not re-generated by designer, if I link after first export I loose the alias property.

  4. #4
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,924
    Vote Rating
    63
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default A fair point

    A fair point


    I was scratching my head earlier thinking why did we put alias in the super class and not the base class. I think it should be moved to the base class.
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    paranella is on a distinguished road

      0  

    Default


    Ok!
    Can't wait for Sencha Designer 2! Good work!

  6. #6
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,359
    Vote Rating
    128
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    This is a bug by design/or flaw in the code generation approach of Designer 1.x.

    Designer 2.x we are now taking the approach of using a single class with overrides. Therefore this issue never occurs:
    http://www.sencha.com/forum/showthre...g-Build-gt-298
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 2