cancel
Showing results for 
Search instead for 
Did you mean: 

How to access a control of another view from different controller?

Former Member
0 Kudos

Hi,

I created a master detail application using template in sap  webide(local).Using xml views.I need to access List in the master page from detail controller.

I tried sap.ui.getCore().getControl("list") method but it returns undefined.

this.getView().byId("list") is successful from master controller.I tried different methods like byId, getElement etc but was unsuccessful.

What i need is to refresh the detail page after approving the item.Master list is refreshing.for this i need access master list control from detail controller.Plz help.

Accepted Solutions (1)

Accepted Solutions (1)

saivellanki
Active Contributor
0 Kudos

Hi Rajeesh,

Since you're using XML views, the id of the view in run-time will be prefixed with the id of parent control.

Now consider your master view id is 'master' then you can try like below in your detail controller.



sap.ui.getCore().byId("master--list");

Check this sample: Plunker

On select of the button placed in Detail will get you the selection mode of list present in Master.

Regards,

Sai Vellanki.

Answers (0)