cancel
Showing results for 
Search instead for 
Did you mean: 

Give static ID to JS View

former_member253610
Participant
0 Kudos

I'm trying to give a static ID to a JS View in manifest.json. Here it is:


{

         "config": {

            "routerClass": "sap.m.routing.Router",

            "viewType": "JS",

            "viewPath": "kalite.view",

            "controlId": "realMainApp",

            "controlAggregation": "pages",

            "transition": "slide"

         },

         "routes": [{

            "pattern": "",

            "name": "mainView",

            "target": "main"

         }],

         "targets": {

            "main": {

               "viewName": "Main",

               "viewId":"MainView",

               "viewLevel" : 1

            }

         }

      }

and I'm trying to get that view by:


sap.ui.getCore().byId("MainView").addDependent(newRecordDialog);

But it doesn't work. It gives "Cannot read property 'addDependent' of undefined" error. Because the view ID is different than what I give:

How can I give a static ID to a static JS View ??

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos