modelcontrollercomponentssapui5updatemodel

Update global Model from controllers in SAPUI5


Is possible update the global model of the project in SAPUI5 from one of my controllers? I have some views with their respective controllers and I need to update the global model from some of this controllers.

Is possible?

Thank you.


Solution

  • Yes. The below code from your controller should give you reference to global model

    this.getOwnerComponent().getModel("modelName")