Skip to Content
0

How to use one view id in another view controller sap ui5

Aug 09, 2017 at 04:19 PM

151

avatar image

Hi,

I have a Master Detail Page application. As of now, I am using Master Page UI eleemnt control Id sap.ui.getCore().byId("_xmlview0--inputid") in Detail View Controller. I know this is not right practice. My doubt is how to use one view control id in another view controller.

Regards

Karthik S

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Srikanth KV Aug 09, 2017 at 04:54 PM
0

Why do you want to access a control id in one view to another view??

In general we access the data attached to the control id that is avilable in a different view using models

Share
10 |10000 characters needed characters left characters exceeded
Sharath M G Aug 09, 2017 at 08:10 PM
0

When you create a control(XML or JS), assign a unique ID. Ex: <button id="myButton">

When it renders, the framework will assign the view, i.e. xmlview1_mybutton.

You can get the control in your controller, using the code this.getView().byId("myButton") and avvoid the need to append the view id(which is assigned dynamically).

Regards,

Sharath

Share
10 |10000 characters needed characters left characters exceeded
Sharath M G Aug 09, 2017 at 08:10 PM
0

When you create a control(XML or JS), assign a unique ID. Ex: <button id="myButton">

When it renders, the framework will assign the view, i.e. xmlview1_mybutton.

You can get the control in your controller, using the code this.getView().byId("myButton") and avvoid the need to append the view id(which is assigned dynamically).

Regards,

Sharath

Share
10 |10000 characters needed characters left characters exceeded
Karthik S Aug 10, 2017 at 05:55 AM
0

Thank you everyone for your suggestions.

Regards

Karthik S

Share
10 |10000 characters needed characters left characters exceeded