A control instance can be found in a fragment by means of its ID.
Due to the above prefixing that guarantees unique IDs, there are different cases possible which require different calls.
Assuming the control has the ID myControl, there are two ways how to retrieve it by its ID.
When NO Fragment ID was given: myControl = sap.ui.getCore().byId("myControl")When a Fragment ID "myFrag" was given: myControl = sap.ui.core.Fragment.byId("myFrag", "myControl")
Retrieving a control instance when the fragment is embedded into a view and the code is inside a controller. The controller is called this in the following examples.
When a fragment ID myFrag was given: myControl = this.byId(sap.ui.core.Fragment.createId("myFrag", "myControl"))