PDA

View Full Version : Listener on reused component doesn't work every time



hallikpapa
24 Mar 2014, 12:15 PM
This is how my view is setup

I have a tab panel with 5 tabs
Each tab has a form on it
Within each form, I am reusing a custom combo box.

So I have a listener in my controller setup to listen for when that combo box is changed.



//Tried it both ways below
'rhux-combo-category': {
change: me.categoryComboChanged
},
'rh-schedulertabpanel rhux-combo-category': {
change: me.categoryComboChanged
},


When I select that combo box, on the first tab, it works just fine. However, when I choose any of the other tabs, and select the combo box again to change values, the event method is never called. What am I doing wrong?

hallikpapa
24 Mar 2014, 12:23 PM
Hah, doesn't fail. As soon as I post, I find the answer. I had to add a 'form' attribute to my control object. Not sure why though. I thought if I just put a space between the tab panel and combo box, it would traverse all the way down the chain to find the combo box.



'rh-schedulertabpanel form rhux-combo-category'