How to get an Control using the byId? But the Control is inside a list, and this list is inside a fragment.
Hi, How to get an Control using the byId? But the Control is inside a list, and this list is inside a fragment. This is the code to add the fragment:
This is the fragment:
In the controller, all of these return undefined:
* As you can see in the input I have add an event the liveChange, with a breakpoint I can see that the input Id is:
oControlEvent.getSource().getId() === "__xmlview3--create--myFragment--myIpt-__xmlview3--create--myFragment--myList-0"
The only way I found to get the input was by removing the id from the fragment ("myFragment") and with the following:
Bu in my opinion this is going to give me a lot of headaches in the future with maintenance.
What I want to do is something similar to "byId", but it is not working, so I need help to understand why this does not work, and directions to the best solution.
to solve that problem I have used sap.ui.core.Fragment.byId(fragmentId, controlId);
thanks to all for the tips, Cristiano.