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
Contributor
simpsoff
Posts: 16
Registered: ‎01-22-2013
My Device: DevAlpha

DateTimePicker disappears when parent Container isn't set to VerticalAlignment.Fill

[ Edited ]

For some reason my DateTimePicker disappers when the parent Container isn't set to VerticalAlignment.Fill, yet everything else shows up just fine. The issue is I can't set the container to .Fill because then it will match heights with the parent scroll view, and be limited to device height, which won't work for the Q10. I'm not doing anything special with it to cause this that i am aware of. Does anyone have insight? Here is the snippit:

 

        ScrollView {
            id: contentContainer
            scrollViewProperties.scrollMode: ScrollMode.Vertical
            scrollViewProperties.pinchToZoomEnabled: false
            verticalAlignment: VerticalAlignment.Fill
            horizontalAlignment: HorizontalAlignment.Fill

            Container {
                layout: StackLayout {
                    orientation: LayoutOrientation.TopToBottom
                }
                verticalAlignment: VerticalAlignment.Fill <- Can't be .Top or problem 
                horizontalAlignment: HorizontalAlignment.Fill

                CustomAgbidsHeader {
                    id: tb
                }
                
                Container {
                    layout: StackLayout {
                        orientation: LayoutOrientation.TopToBottom
                    }
                    leftPadding: Qt.stylePageEdgeSpace
                    rightPadding: Qt.stylePageEdgeSpace
                    topPadding: Qt.stylePageEdgeSpace
                    bottomPadding: Qt.stylePageEdgeSpace
                    
                    DropDown {
                        id: product
                    }
                    CustomInputLabel {
                        text: "Delivery Date:"
                    }
                    DateTimePicker {
                        id: deliveryDate
                        mode: DateTimePickerMode.Date
                        //title: "Delivery Date:"
                    }
                    CustomInputLabel {
                        text: "Volume Available:"
                    }
                    Container {
                        layout: StackLayout {
                            orientation: LayoutOrientation.LeftToRight
                        }
                        TextField {
                            id: volume
                            verticalAlignment: VerticalAlignment.Center
                            inputMode: TextFieldInputMode.NumbersAndPunctuation
                            hintText: "Enter quantity..."
                        }
                        DropDown {
                            id: units
                            maxWidth: 400.0
                        }
                    }
                    CustomInputLabel {
                        text: "Comments/Info:"
                    }
                    TextArea {
                        id: comment
                        hintText: "Enter optional comment..."
                        maximumLength: 5000
                        minHeight:300
                        layoutProperties: StackLayoutProperties {
                            spaceQuota: 1
                        }
                    }
                }
            }
        }

 Which looks like this:

 

But if i try and get rid of the .Fill (So the content will scroll on the Q10, or other screens that "overflow"), i get this:

 

Does anyone have any ideas at all? I can post the full page snippet if that's helpful.

Please use plain text.
Contributor
simpsoff
Posts: 16
Registered: ‎01-22-2013
My Device: DevAlpha

Re: DateTimePicker disappears when parent Container isn't set to VerticalAlignment.Fill

[ Edited ]

Well, I tried many different things, and asked some friends, and it looks like it might just be a bug in SDK 10.1.0.1020, with a DateTimeField inside of a ScrollView. In the end, what I did was quite a hack, but it works enough for what i need it to do:

 

Forcing a minHeight, and then on the onExpandedChanged signal, toggling the minimum heights.

 

                   DateTimePicker {
                        id: deliveryDate
                        mode: DateTimePickerMode.Date
                        //title: "Delivery Date:"
                        minHeight:100
                        onExpandedChanged: {
                            if (expanded) {
                                minHeight = 600;
                            }else{
                                minHeight = 100;
                            }
                        }
                    }

 

It's pretty brutal, but when there is a bug in the SDK there isn't much you can do I guess. If anyone has any better solutions though I'd love to get rid of this hack.

Please use plain text.