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

Native Development

Reply
Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Docked Container won't receive onTouchCapture

[ Edited ]

 

I'm having issues with the following 9-scale button.  I can't get it the 9-scale button to receive onTouchCapture on a press with the second container in place.  If I delete the second container it work perfectly as expected.  The chevron container also receives the touch if I slide the touch into the box. 

 

                        Container {
                            id: chevronhome_cont
                            layout: DockLayout {
                            }
                            onTouchCapture: {
                                console.log("chevronhome onTouchCapture")
                            }
                            touchPropagationMode: TouchPropagationMode.PassThrough
                            overlapTouchPolicy: OverlapTouchPolicy.Allow
                            verticalAlignment: VerticalAlignment.Fill
                            ImageButton {
                                defaultImageSource: "asset:///images/shortgreychevron.png.amd"
                                pressedImageSource: "asset:///images/lightgreychevron.png.amd"
                                horizontalAlignment: HorizontalAlignment.Fill
                                verticalAlignment: VerticalAlignment.Fill
                                onTouchCapture: {
                                    console.log("ImageButton onTouchCapture")
                                }
                                onClicked: {
                                    console.log("chevronhome clicked")
                                }
                            }
                            Container {
id:secondcontainer touchPropagationMode: TouchPropagationMode.PassThrough overlapTouchPolicy: OverlapTouchPolicy.Allow layout: StackLayout { orientation: LayoutOrientation.LeftToRight } ImageView { touchPropagationMode: TouchPropagationMode.PassThrough overlapTouchPolicy: OverlapTouchPolicy.Allow imageSource: "asset:///images/icons/home.png" verticalAlignment: VerticalAlignment.Center } } // Container

 Can anyone give me some insight into what I'm doing wrong?

 

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: Docked Container won't receive onTouchCapture

I've investigated this further  - the above code works if I swap out the 9-slice image button with a straight button.  If someone can confirm this issue I'll report it as a bug.

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: Docked Container won't receive onTouchCapture

I've further simplified the code down.  Frm what I can tell the OverlapTouchPolicy doesn't seem to function on a DockLayout for a Tap.  If I slide in it will receive the touch (just not the click).

 

                        Container {
                            id: chevronhome_cont
                            layout: DockLayout {
                            }
                            onTouchCapture: {
                                console.log("chevronhome onTouchCapture")
                            }
                            touchPropagationMode: TouchPropagationMode.Full
                            overlapTouchPolicy: OverlapTouchPolicy.Allow
                            verticalAlignment: VerticalAlignment.Fill
                            Button {
                              text: "teting"
                              onClicked: {
                              console.log("button clicked")
                              }
                              }
                            ImageView {
                                touchPropagationMode: TouchPropagationMode.Full
                                overlapTouchPolicy: OverlapTouchPolicy.Allow
                                imageSource: "asset:///images/icons/home.png"
                                verticalAlignment: VerticalAlignment.Center
                            }
                        } // Container chevronhome_cont
                    } // Container chevronset_cont

 

---
If you find my post helpful please "like" it and "accept as a solution"