Confused on ItemId versus Id when used with controller / componentquery

Confused on ItemId versus Id when used with controller / componentquery

I had thought that a controls id always would work and that only itemId works when the control is either a sibling or child. I've got the code below for a controller that listens for a button click (among other things). It does not respond when the button (continueButtonId) is set as the id property of the button, but the controller does respond when continueButtonId is the itemId of the button.

When it's about writing selectors for ComponentQuery, itemId and id are the same, when it's about getting direct items of a container then of course you use itemId.

If an event is not fired then very probably that you have a wrong selector, so you can directly in console to test if you selector is ok and returns some results by using Ext.Component.query(selector).

In your case should work both. Usually when there are more views per controller I write selectors for buttons this way:

vadimn,
is 'views_xtype' the name of your controller?
Also, I'm wondering if what I found is a bug. I would have though both would work (itemid and id) in ComponentQuery but the most definitely do not. In my example it is easy to set itemId to blank and Id to the same value and the controller never sees the event.

Even More to be confused about now

Even More to be confused about now

So, sticking to the original topic, the code below does show that doing a componentquery for itemId returns the component, id does not.

Rubbing salt into this wound, it turns out that the component query fails (in some cases) in the compiled version of this same code. I have not yet set up m very simple repro, but I'm thinking this is just buggy code (on sencha's side) but I'd love to be shown wrong (or at least explained to)

You are testing when you have both itemId and id configured ? I see that yes, that may be a reason of the problem, because the selector parser uses filterById method, and within it is used component.getItemId