Search code examples
dojodojox.mobiledojox.app

How to enable multiple views at once using dojox/app?


I am building a web application using dojox/app, and my config.json file is the following:

{
"id": "app",
"name": "app",
"description": "My app",
"dependencies": [
    "commonapp/app",
    "commonapp/BaseViewController",
    "dojo/store/Memory",
    "dojox/app/utils/mvcModel",
    "dojox/mvc/EditStoreRefListController",
    "dojo/store/Observable"
],
"controllers": [
"dojox/app/controllers/Load",
"dojox/app/controllers/Transition",
"dojox/app/controllers/Layout",
"dojox/app/controllers/HistoryHash"],

"stores": {

},
"models": {

},

"defaultView": "MainTemplate",
"views": {
    "MainTemplate": {
        "template": "commonapp/templates/MainTemplate.html",
        "controller": "commonapp/templates/MainTemplate.js",
        "nls": "commonapp/templates/nls/MainTemplate",
        "defaultView": "LoginView",
        "views": {
            "LoginView": {
                "template": "commonapp/login/LoginView.html",
                "controller": "commonapp/login/LoginView.js",
                "nls": "commonapp/login/nls/LoginView"
            },
            "AppView": {
                "template": "commonapp/app/AppView.html",
                "controller": "commonapp/app/AppView.js",
                "nls": "commonapp/app/nls/AppView",
                "views": {
                    "LeftContainerView": {
                        "template": "commonapp/app/leftContainer/LeftContainerView.html",
                        "controller": "commonapp/app/leftContainer/LeftContainerView.js",
                        "nls": "commonapp/app/leftContainer/nls/LeftContainerView"
                    },
                    "RightContainerView": {
                        "template": "commonapp/app/rightContainer/RightContainerView.html",
                        "controller": "commonapp/app/rightContainer/RightContainerView.js",
                        "nls": "commonapp/app/rightContainer/nls/RightContainerView"
                    }
                }
            }
        }
    }
}
}

Everything works fine until I added the LeftContainerView and RightContainerView. In this particular case, I want both views to be active at the same time. The problem is, if I set a default view for either LeftContainerView or RightContainerView, one the default one appears. But, if I programatically trigger events to show both views when the AppView is loaded, one of them will be automatically hidden, and the problem stays.

Basically, the idea is that AppView will have a fixedsplitter, and on each of the panes, I want to place one of the child views. Does anyone have an idea of how can I get both LeftContainerView and RightContainerView active at the same time?


Solution

  • Did you try this way:

    "defaultView": "LeftContainerView+RightContainerView"
    

    as indicated in https://dojotoolkit.org/reference-guide/1.9/dojox/app.html#defaultview ?

    (Would also be useful to tell the Dojo version you are using.)