I have a controller with a ref of myListview #myAddButton.
ref {
add: 'myListview #myAddButton'
}
I also have a control with
control: {
add: {tap: 'onAddTapped'}
}
If I have another view with a button with an id of #myAddButton but no controller then the other view seems to get called rather than this controller. If I rename the myAddButton id to something else then it works fine.
The question is do the id's for elements have to be unique across all views in order for the controller to route properly?
id has to be unique, itemsId has to be unique to that container. It is best to stay away from them for this reason. I use a custom property 'action' to specify what a button is for.
id has to be unique, itemsId has to be unique to that container. It is best to stay away from them for this reason. I use a custom property 'action' to specify what a button is for.
I had one panel where I had a list and a button in it and another panel where I had a different list id but the same button id. Both panels had different ids and xtypes. These two panels were in a card layout in another panel..
It ran ok and the buttons were being controlled by a controller.
Should I have got an error if there were duplicate id's?
ie the ref I had, specifically said that I wanted to use the id within the xtype specified