on 2018 Dec 12 9:38 AM
In my MainController I'd like to call a function from my ManualUploadController by pushing a button
The function call itself is working fine like this:
var oManualUploadController = new ManualUpload();
var backendData = oManualUploadController.onGenerateBackendData();
However, in the "onGenerateBackendData()" method, I retrieve models for example like this:
var oModel = this.getView().getModel('odataDetails');
What's funny is:
The ManualUploadController creates a Dialog with some logic in it and the MainController is the "mainpage" from where the dialog gets opened.
When initially accessing the mainpage and trying to push/execute that funciton, I get the error"Uncaught TypeError: Cannot read property 'getModel' of undefined".
But when the Dialog has already been opened previously, then closed again and then the button on the mainpage gets pushed, the function call works fine without any errors.
Do I have to instantiate the controller somehow or how can I solve this problem?
I really hope, I managed to explain my problem so that you understand it. Please let me know if I should try again!
Thanks!
Have you used the addDependent when you create the dialog? That could be a good reason 😉
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.