Results 1 to 8 of 8

Thread: Error in console: Unrecognized alias: widget.feedform

  1. #1
    Sencha User
    Join Date
    Jul 2018
    Posts
    7
    Vote Rating
    0
      0  

    Default Error in console: Unrecognized alias: widget.feedform

    I have the following problem. When I press the 'Add New Feed' button in the feeds.js folder, which should call the 'onNewFeed' function (located in the MainController.js file), an error appears in the console 'Unrecognized alias: widget.feedform'. When I add 'MainController.js' in the file' requires: ['FeedViewer.view.main.FeedForm'] the console displays a '[Ext.Loader] error Some requested files failed to load.'

    HTML Code:
    Structure folders:
    
    //FeedViewer
        //app
            //view
               //main
                   /MainController.js
                   /MainModel.js
        //classic
        //modern
            //src
                //view
                    //main
                        /FeedForm.js
                        /Feeds.js
                        /Main.js
    
    
    //MainController.js
    
    Ext.define('FeedViewer.view.main.MainController', {
        extend: 'Ext.app.ViewController',
        alias: 'controller.main',
    
         onNewFeed: function () {
            var navView = this.getView(),
                form = navView.child('feedform');
    
            if (!form) {
                navView.push({
                    xtype: 'feedform',
                    reference: 'feedform'
                });
            } else {
                navView.setActiveItem(form);
            }
        }
    
    });
    
    
    //FeedForm.js
    
    Ext.define('FeedViewer.view.main.FeedForm',{
        extend:'Ext.form.Panel',
        xtype:'feedform',
    
        requires:[
            'Ext.Button',
            'Ext.field.Select',
            'Ext.form.FieldSet',
            'Ext.Toolbar'
        ],
    
        title:'New RSS Feed',
    
        items:[{
            xtype:'fieldset',
            items:[
                {
                    xtype:'selectfield',
                    label:'Select a new feed',
                    labelAlign:'top',
                    allowBlank:false,
                    name:'feedUrl',
                    options:[
                        {value :'http://rssfeeds.usatoday.com/usatoday-NewsTopStories', text :'USA Today Top Stories'},
                        {value :'http://sports.espn.go.com/espn/rss/news', text :'ESPN Top News'}
                    ]
                }
            ]
        },{
            xtype:'toolbar',
            docked:'bottom',
            items:[{
                xtype:'button',
                reference:'savebutton',
                action:'save',
                ui:'action',
                text:'Add'
            }]
        }]
    });
    
    
    //Feeds.js
    
    Ext.define('FeedViewer.view.main.Feeds',{
        extend:'Ext.grid.Grid',
    
        xtype:'feedslist',
    
        requires:[
            'ContactsApp.view.feeds.MainController',
            'ContactsApp.view.feeds.MainModel'
    
        ],
    
        viewModel:'feeds',
        controller:'feeds',
    
    
        columns:[
            {
    
                dataIndex:'feed',
                text:'feed'
            }
    
        ],
    
        items:[
            {
                xtype:'toolbar',
                docked:'left',
                items:[
                    {   
                        xtype:'button'
                        text:'Add New Feed',
                        iconCls:'fa fa-plus',
                        listeners:{
                            click:'onNewFeed'
    
                        }
    
                    }
                ]
            }
        ]
    });
    
    //Main.js
    
    Ext.define('FeedViewer.view.main.Main',{
        extend:'Ext.tab.Panel',
        xtype:'app-main',
    
        requires:[
            'Ext.window.MessageBox',
    
            'FeedViewer.view.main.MainController',
            'FeedViewer.view.main.MainModel',
            'FeedViewer.view.main.List'
    
        ],
    
        controller:'main',
        viewModel:'main',
        layout:'column',
    
        items:[{
            xtype:'feedlist',
            columnWidth:0.5
        }
    });

  2. #2
    Sencha User
    Join Date
    Jul 2018
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Maybe you have any tips?




  3. #3
    Sencha User
    Join Date
    Jun 2018
    Posts
    8
    Vote Rating
    0
      0  

    Default

    you should put
    'FeedViewer.view.main.FeedForm'
    into your
    'FeedViewer.view.main.Feeds'
    's
    requires

  4. #4
    Sencha User
    Join Date
    Jul 2018
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by phoebej89 View Post
    you should put
    'FeedViewer.view.main.FeedForm'
    into your
    'FeedViewer.view.main.Feeds'
    's
    requires

    I did it so but I still have an error:

    [Ext.Loader] Some requested files failed to load.

  5. #5
    Sencha User
    Join Date
    Jun 2018
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by Umbo View Post
    I did it so but I still have an error:

    [Ext.Loader] Some requested files failed to load.
    requires:[
    'ContactsApp.view.feeds.MainController',
    'ContactsApp.view.feeds.MainModel'

    ],
    did you confirm your app's namespace?
    it's not 'FeedViewer'

  6. #6
    Sencha User
    Join Date
    Jul 2018
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by phoebej89 View Post
    requires:[
    'ContactsApp.view.feeds.MainController',
    'ContactsApp.view.feeds.MainModel'

    ],


    did you confirm your app's namespace?
    it's not 'FeedViewer'
    requires:[
    'FeedViewer.view.feeds.MainController',
    'FeedViewer.view.feeds.MainModel'

    ],

    but still is error
    [Ext.Loader] Some requested files failed to load.

  7. #7
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,268
    Answers
    3990
    Vote Rating
    1468
      0  

    Default

    Have you run a Cmd watch or dev build? Does it succeed? Cmd also generates meta data on where classes are and what alias they have which could help you even if you don't have things properly... so long as Cmd looks at that directory which looks like you are in a universal app so it should be fine with the file structure posted.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  8. #8
    Sencha User
    Join Date
    Jul 2018
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    Have you run a Cmd watch or dev build? Does it succeed? Cmd also generates meta data on where classes are and what alias they have which could help you even if you don't have things properly... so long as Cmd looks at that directory which looks like you are in a universal app so it should be fine with the file structure posted.
    In classic, everything works. In the modern version, the Main.js file does not look for FeedForm.js and Feeds.js files in the modern folder only in the app folder.
    I tried to move FeedForm.js and Feeds.j to the app folder, listeners are not working in the Main.js file

Similar Threads

  1. Replies: 4
    Last Post: 6 May 2014, 1:25 PM
  2. Replies: 1
    Last Post: 5 Nov 2012, 6:44 PM
  3. Replies: 5
    Last Post: 17 Sep 2012, 2:46 PM
  4. Cannot create an instance of unrecognized alias: widget.
    By landed in forum Sencha Touch 2.x: Q&A
    Replies: 9
    Last Post: 24 Feb 2012, 2:41 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •