1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    56
    Vote Rating
    1
    Bob Wilson is on a distinguished road

      0  

    Default Ext.load.setConfig doesn't seem to work

    Ext.load.setConfig doesn't seem to work


    Hi all,

    I'm trying to use the new MCV scheme using the new IBM XWork server (ex-Domino) as a backend.

    The HTML file that launches my app is hosted within a Domino Database on this address :
    http://192.168.1.2/Demo.nsf/index

    This triggers authentication for later database access (the database is Demo.nsf)

    But the root for my js files & resources is this one :
    http://192.168.1.2/myApp/

    From this root, every resources follow the proposed MVC scheme :
    - app
    --- controller
    --- model
    --- view

    So http://192.168.1.2/myApp/app/ is where the app.js file is hosted, and so on...

    So, as the start URL of my application will be http://192.168.1.2/Demo.nsf/index
    ... I'll need to use the setConfig.paths properties to tell the dynamic loader where to find the classes resources.

    Here is an example of config :

    Code:
    Ext.Loader.setConfig({
        enabled: true,
        // I've used various syntaxes here but always with the same result anyway.
        // I even tried stupid things like absolute paths, with slashes or backslaches !
        paths: {'Ext': '.', 'myApp':'../../myApp'}
    });
    
    
    Ext.create('Ext.app.Application', {
     
        name: 'myApp',
        appFolder: 'app',
        //autoCreateViewport: false,
     
        controllers: [
            'ControllerFormField'
        ],
    
    
        launch: function() {
    
    
            Ext.create('Ext.container.Viewport', {
                layout: 'fit',
                html: 'hello world'
            });
        console.log('End of process');
        }
    });
    But whatever the paths I mention, Ext is ALWAYS trying to load my controller from the path :
    "/Demo.nsf/app/controller/ControllerFormField.js"

    Is it a bug, or ?

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,574
    Vote Rating
    311
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Isn't it just because you're setting an appFolder on your application?

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    56
    Vote Rating
    1
    Bob Wilson is on a distinguished road

      0  

    Default Unfortunately not

    Unfortunately not


    Sorry, no.
    I've tried various tests, even moving the app.js in an out of the app folder, using the "appFolder" param or not.

    In fact, the problem is that whatever the config I'm using, Ext is always requesting the resource from the Domino database root URL "/Demo.nsf"

    It's a bit like if I could not go further than this point when trying to go backward mentionning "../../" relative paths

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,574
    Vote Rating
    311
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I'm pretty sure it's your appFolder:

    http://docs.sencha.com/ext-js/4-1/#!...-cfg-appFolder

    If you don't set it then it'll just default to 'app', which will give exactly the behaviour you're describing. If you set it explicitly to 'app' (as in your posted code) it'll also give the behaviour you're describing. Just set it to the correct path and everything should work fine.

  5. #5
    Sencha User
    Join Date
    Sep 2010
    Posts
    56
    Vote Rating
    1
    Bob Wilson is on a distinguished road

      0  

    Default OK, one point !

    OK, one point !


    OK ! I've tried to use an asbolute path in the appFolder param and now Ext is getting the resource at the right place.

    Now, paths problems seems to have moved somewhere else :-)
    Like in the MVC tutorial, I'm using a view which uses an alias (widget.wizard) and when I'm using this alias in the app.js, I'm getting the error "Cannot call method 'substring' of undefined"

    So I guess that the dynamic Loader didn't find where I've declared my view & alias.
    I'll try to play again with absolute paths in the Loader.config to see if I can solve the problem.

    Thank you for your time, you have helped to jump to the 2nd step :-)

  6. #6
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,574
    Vote Rating
    311
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    That error simply means that the class isn't being loaded before it's being used. You just need to include a requires block on the class that needs it.

    As aliases are totally arbitrary the loader won't know which files need loading based purely on alias. While it is possible to generate a manifest that provides that information it's not something commonly done in real applications - much easier just to include the requires block.

  7. #7
    Sencha User
    Join Date
    Sep 2010
    Posts
    56
    Vote Rating
    1
    Bob Wilson is on a distinguished road

      0  

    Default Great !

    Great !


    This advice solves all.
    Thanks a lot.

Thread Participants: 1

Tags for this Thread

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