Thank you for reporting this bug. We will make it our priority to review this report.
Controller not getting events
Architect Build tested:
Steps to reproduce the problem:
- I'm not sure what I did, but nothing reaches the controller no matter what I do.
- Each button has an itemID. I have 16 buttons on the page (simulating a phone keypad panel 1-0,*,#, CONTACTS, SEND, DELETE. [i]-- I thought the itemID would give me the xtype
- Possibly deep nesting of buttons in containers.
- Possibly during project changes something was lost.
- Possibly After adding event binding to one of the buttons, the rest of the buttons don't reach the controller.
- Tried in a new project with itemID and then with ID
The result that was expected:
- Try all possibilities
- Start from these: [**] cntrl:kbController, with controller action for Ext.Button Tap event. console.log("kbController: button tapped");[**] Deeply nested view:mainTabPanel / tab: keypad / kbPanel / kbTop + kbGrid[**] kbGrid: / kbPanelRowA: kbBtn1,kbBtn2,kbBtn3; / kbPanelRowB: kbBtn4, kbBtn5, kbBtn6 Note: I figured that the itemId is what I set, so that I get the xtype.And that the itemId would be caught by the controller as the id to look for[**] In the controller action selector try: 'kbBtn12, or 'button kbBtn12' or just 'button'[**] In the kbBtn2 add Id 'kbBtn2' and in selector try: '#kbBtn2'[**] Add an event binding to kbBtn1 for Tap: console.log("btn 1 tapped")
- Preview in chrome, hit ctrl-shift-i to see console.
The result that occurs instead:
- console to show: 'kbController: button tapped'
- console only shows the kbBtn1 tap if defined
Screenshot, Project, or Video:
- Win7 and WinXP pro in Preview on Chrome
Can you share your controller code so I can get a better sense for what your trying?
The controller code is simply a BUTTON TAP controller action
tried different selectors, and none worked.
The code is:
Selectors that I tried: button, #kbButton2, button kbButton2
It seems the kbButton1 with an event binding added action in the VIEW:
is the cause.
So instructions to reproduce are simpler:
In Architect 2:
MainView with two buttons.
In itemId set to kbBtn1, and the second button's itemId to kbBtn2
On the first button add Event Binding / basic event for TAP
Make a Controller and add Actions / Controller Action for button TAP
The bug occurs.
Try changing the Controller action's selection: to button. or to kbBtn2 and it won't work.
Ok so I am able to get it work and I suspect it's because of one thing
1. create a new touch project
2. add a form panel
3. add 2 buttons
itemId: kbBtn1 and kbBtn2
4. add a basic event binding to kbBtn1 (config pane, click + next to events, choose basic, and select tap event)
5. double click tap onkbBtn1Tap (to edit)
6. add the following code
7. add a controller
console.log('normal button tap');
8. add MyFormPanel1 as a view of the controller and select remove (either choice would be fine here)
9. add a controller action to MyController
10. targetType: Ext.Button, name: tap (should fill in controlQuery: button, fn: onButtonTap1 for you)
11. edit tap onButtonTap1 controller action and add the following code
Save the project
console.log('controller action tap');
Preview it from a web server e.g. http://localhost/sandbox/pashute/app.html
Click on button1:
controller action tap app/controller/MyController.js?_dc=1340031614578:31
normal button tap app/view/MyFormPanel1.js?_dc=1340031614583:42
Click on button2 2 times:
2 controller action tap app/controller/MyController.js?_dc=1340031614578:31
So your saying that the missing thing here is that I did not add the MyFormPanel1 in the controller Views ?
But when I do that, it says: MyFormPanel1 is already defined. Do you wish to replace it? or something like that...
Yeah that's ok it's asking if you'd like to continue including it in application or not. Typically you would not but choosing to keep it at the app level won't hurt anything