1. #1
    Sencha Premium Member
    Join Date
    Dec 2012
    Posts
    6
    Vote Rating
    0
    plchia is on a distinguished road

      0  

    Default how to set different folder rather using app folder?

    how to set different folder rather using app folder?


    Hi,

    I followed this link for my setup : http://docs.sencha.com/extjs/4.1.3/#...and_app_single. I managed to get my project build successfully and run ok using default app folder.

    My command to generate app and build application
    Code:
    sencha -sdk /path/to/sdk generate app MyApp /path/to/MyApp
    sencha app build
    I then try to rename the app folder to other name (mytest) and change the appFolder configuration in app.js and sencha.cfg's classpath to mytest. When run build command, it throws error failed to find ..../app/app.js. I've also tried to keep both app folder and create another mytest folder and copy all other sub folders into mytest folder and run the build command again with the sencha.cfg's classpath set to mytest, however I found in all-classes.js the appFolder is set to 'app' and when I run the application the screen show blank with no error message in firebug (using firefox browser). Here are my settings, can someone please help mm I get it correctly and where should I configure if not using app folder as my application folder?

    Error when build project
    Code:
    [ERR] Failed to find file(s) for depdency reference C:\d3_dev\workarea\SinglePageApp\sencha-compile-temp-dir\b8e968f1-b744-4c87-a6cd-42dcf74457b3\script-file-1.js::DirectiveRequire::../../app/app.js/
    [ERR] Error executing page compilation Failed to find any files for C:\d3_dev\workarea\SinglePageApp\sencha-compile-temp-dir\b8e968f1-b744-4c87-a6cd-42dcf74457b3\script-file-1.js::DirectiveRequire::..
    /../app/app.js/
    [ERR]
    [ERR] BUILD FAILED
    [ERR] com.sencha.exceptions.ExBuild: com.sencha.exceptions.ExBuild: Failed to find any files for C:\d3_dev\workarea\SinglePageApp\sencha-compile-temp-dir\b8e968f1-b744-4c87-a6cd-42dcf74457b3\script-fi
    le-1.js::DirectiveRequire::../../app/app.js/
    [ERR]
    [ERR] Total time: 17 seconds
    [ERR]
    [ERR] BUILD FAILED
    [ERR] com.sencha.exceptions.BasicException: The following error occurred while executing this line:
    [ERR] C:\d3_dev\workarea\SinglePageApp\.sencha\app\build-impl.xml:410: com.sencha.exceptions.ExBuild: com.sencha.exceptions.ExBuild: Failed to find any files for C:\d3_dev\workarea\SinglePageApp\sench
    a-compile-temp-dir\b8e968f1-b744-4c87-a6cd-42dcf74457b3\script-file-1.js::DirectiveRequire::../../app/app.js/
    [ERR]   at com.sencha.
    [ERR] command.compile.PageCommand.execute(PageCommand.java:135)
    [ERR]
    [ERR] Total time: 18 seconds
    [ERR] com.sencha.exceptions.BasicException: The following error occurred while executing this line:
    C:\d3_dev\workarea\SinglePageApp\.sencha\app\build-impl.xml:410: com.sencha.exceptions.ExBuild: com.sencha.exceptions.ExBuild: Failed to find any files for C:\d3_dev\workarea\SinglePageApp\sencha-comp
    ile-temp-dir\b8e968f1-b744-4c87-a6cd-42dcf74457b3\script-file-1.js::DirectiveRequire::../../app/app.js/
    
    C:\d3_dev\workarea\SinglePageApp>
    My app.js
    Code:
    Ext.application({
        name: 'SinglePageApp',
        appFolder: 'mytest',
        requires: ['Ext.layout.container.Border',
                   'SinglePageApp.view.MyFilter'  
        ],
        
        controllers: ['CMyForm',
                      'CMyGrid'],
        
        
        autoCreateViewport: false,
        
        launch: function() {
            Ext.create('Ext.container.Viewport',{
                layout : 'border',
                items : [{
                    region : 'west',
                    layout: 'fit',
                    collapsible : true,
                    split: true,
                    width : 200,
                    xtype : 'my-filter',
                    title: 'Controls / Filters'
                },{
                      region : 'center',
                    layout: 'fit',
                    title : 'My Grid',
                    xtype : 'my-grid'
                }]
            });
        }
    });
    My .sencha/app/sencha.cfg
    Code:
    #Mon, 29 Apr 2013 16:48:36 +0800
    app.name=SinglePageApp
    app.framework=ext
    app.classpath=${app.dir}/mytest
    app.build.dir=${workspace.build.dir}/mytest
    
    app.cmd.version=3.1.1.274
    app.id=038849d1-45d2-4add-a843-0aecfb84f88f

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So you are just trying to rename the app directory to mytest? Here are the steps that I just took to do this:

    > cd /path/to/ext-4.2.0.6663
    > sencha generate app MyApp /path/to/MyApp
    > cd /path/to/MyApp

    --rename app directory to mytest
    --edit .sencha/app/sencha.cfg to change app.classpath to: app.classpath=${app.dir}/mytest
    --edit index.html to point to mytest/app.js
    --edit app.js to add appFolder : 'mytest'

    > sencha app build

    Launched build in browser and worked. Is this what you were after?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Dec 2012
    Posts
    6
    Vote Rating
    0
    plchia is on a distinguished road

      0  

    Default


    Thanks mitchellsimoens, I missed out the changes in index.html. I get the build ok after change my index.html to mytest. I am not sure this should log in another post, I found that in development run ok and no errors in Firebug but running the build version throwing error, end up remove my codes one by one to check which section causing the error.

    I stimulated same problem by changing the default Viewport.js which created by generate app command and using other default generated files. I setup 2 projects, one using build version and one doesn't. How can I setup/make sure my development running on the same 'environment' so that it can prompts me earlier during my development if my codes go wrong?

    Ext.application that will throws error when running the build output
    Code:
    Ext.define('SinglePageApp.view.Viewport', {
        renderTo: Ext.getBody(),
        extend: 'Ext.container.Viewport',
        requires:[
            'Ext.tab.Panel',
            'Ext.layout.container.Border'
        ],
    
        layout: {
            type: 'border'
        },
    
        items: [{
            region: 'west',
            xtype: 'panel',
            title: 'west',
            width: 150
        },{
            region: 'center',
            xtype: 'tabpanel',
            items:[{
                title: 'Center Tab 1',
                items:[{
                    layout: 'form',
                    items: [{
                        xtype: 'htmleditor'
                    }]
                }]
            }]
        }]
    });
    It throws error when run index.html and I guess it's because of layout configuration cannot find the container.
    Code:
    TypeError: b.setOwner is not a function
    If you change to either A or B, no error found.
    Code:
    (A)
     region: 'center',
            xtype: 'tabpanel',
            items:[{
                title: 'Center Tab 1',
                items:[{
                    xtype: 'container',
                    layout: 'form',
                    items: [{
                        xtype: 'htmleditor'
                    }]
                }]
            }]
    
    (B)
     region: 'center',
            xtype: 'tabpanel',
            items:[{
                title: 'Center Tab 1',
                items:[{
                    items: [{
                        xtype: 'htmleditor'
                    }]
                }]
            }]

  4. #4
    Sencha User
    Join Date
    May 2010
    Location
    Sapiranga, Rio Grande do Sul, Brazil
    Posts
    77
    Vote Rating
    1
    sergiomichels is on a distinguished road

      0  

    Default


    I'm with the same "b.setOwner is not a function" error in my project. Did you solved your problem?

  5. #5
    Sencha Premium Member
    Join Date
    Dec 2012
    Posts
    6
    Vote Rating
    0
    plchia is on a distinguished road

      0  

    Default


    I get the error resolved with the change of either (A) or ( from my last log