Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
rkrull79
Posts: 20
Registered: ‎01-05-2011
My Device: Playbook 16GB, Curve 9300
My Carrier: MTN

Custom Modal Dialog - Prevent swipe event on QNX list underneath

[ Edited ]

i've got a screen with a list of elements. I'm using the "qnx.ui.listClasses.List" class to display the list. When the user clicks on the item in the list I display my own custom modal dialog. The dialog (a qnx.ui.core.Container)  itself partially covers the list underneath but the semi transparent overlay (also a qnx.ui.core.Container) ,in between the dialog and the list , covers the entire screen.

 

The overlay prevents the user from clicking on the list below but for some reason the user is still able to "flick" on the list to scroll it. I've tried adding a TransformGestureEvent.GESTURE_SWIPE event listener to the overlay panel to swallow the swipe events but this doesn't seem to work. Any ideas on how to prevent the user from being able to interact with the list when the modal dialog is displaye over it?

Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Custom Modal Dialog - Prevent swipe event on QNX list underneath

have you tried cancelling the event  by calling event.stopImmediatePropagation() in your event handler?

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
New Developer
New Developer
JLX
Posts: 17
Registered: ‎07-08-2010
My Device: Bold 9700
My Carrier: Rogers

Re: Custom Modal Dialog - Prevent swipe event on QNX list underneath

On the transparent overlay underneath your modal dialog add the stopPropogation() method to prevent the event from travelling further up the tree. eg:

private function catchTouchEvent(e:TouchEvent):void {
e.stopPropagation();
}

See if that does the trick.
Please use plain text.
Contributor
rkrull79
Posts: 20
Registered: ‎01-05-2011
My Device: Playbook 16GB, Curve 9300
My Carrier: MTN

Re: Custom Modal Dialog - Prevent swipe event on QNX list underneath

Thanks. Turns out I wasn't adding event listeners for the correct types of events. I added event listeners for the following event types:
- TouchEvent.TOUCH_BEGIN
- TouchEvent.TOUCH_MOVE
- MouseEvent.MOUSE_DOWN
- MouseEvent.MOUSE_MOVE

And then call event.stopImmediatePropagation() in the event handler. This resolved the issue
Please use plain text.