Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Receive the attribute component from the controller.


Please tell me where I'm wrong.

I have created a component multiple angles and multiple controllers. I added an attribute 'main_data' to the component.

If I call this attribute in the code fragment, everything works correctly.


sap.ui.jsfragment("sap.ui.....forms.view.MonoTable_Edit", {

  createContent: function(oController) {

  var oDFC = oController.getOwnerComponent().main_data;


If I call this attribute in the code of the controller, the console browser (FireFox) I get the error:

"TypeError: this.getOwnerComponent is not a function"


addNewEntry: function(){

  var o_entry;

  var component;

  component = this.getOwnerComponent();

  o_entry = component.main_data.output.lines[0];


Tell me, how else can you turn to the component from controller?

Former Member

SAPUI5 SDK - Demo Kit

press: jQuery.proxy(oController.testMethod  , oController)


press: [oController.testMethod  , oController]

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question