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
Posts: 16
Registered: ‎01-17-2013
My Device: None
My Carrier: None
Accepted Solution

Issue with DateTimePicker not expanding correctly

Hello,

 

I'm currently tinkering around with some of the form objects and I've put a DateTimePicker into my QML code.  It shows up fine with the current date selected but when I click on the picker to change the date, it only shows the top row of the month/day/year scroll wheels.

 

Here are two screenshots (before/after) of what's happening:

http://i.imgur.com/1PuWM4s.png

http://i.imgur.com/aDiIZ3a.png

 

Here's my QML code:

 

 

Page {
titleBar: TitleBar {
title : "Add Transaction"
}
Container {
background: Color.create ("#e4f3f9")

Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill

topPadding: 20
leftPadding: 20
rightPadding: 20
bottomPadding: 20

layout: DockLayout {}

Container {
id: screenInfo
verticalAlignment: VerticalAlignment.Top

Container {
DateTimePicker {
title: "Date"
}
}
Label {
text: qsTr("Create a username:")
textStyle {
color: Color.create ("#545454")
}
}

....
}
}
}

} // end of Page}

 

Sorry, it appears the formatting turns to rubbish in here and none of the standard bb codes for inserting code seem to work.

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Issue with DateTimePicker not expanding correctly

Hi! This happens because of DockLayout. Date control has no space to expand to. Use a top-level ScrollView and put Container with vertical StackLayout inside of it.

If it doesn't occupy all the available space horizontally, add preferredWidth: Infinity parameter.

There's code formatting button on toolbar.

Andrey Fidrya, @zmeyc on twitter
Highlighted
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Issue with DateTimePicker not expanding correctly

For the formatting, in the edit area there should be a "C-on-a-clipboard" icon which opens a popup window into which you can paste your code. Save that (the Insert button) and it preserves the formatting nicely.

 

You can edit your original post by choosing Edit Reply from the Options dropdown at the upper right of your message.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
Posts: 16
Registered: ‎01-17-2013
My Device: None
My Carrier: None

Re: Issue with DateTimePicker not expanding correctly

Thanks! Turning the initial container into a ScrollView fixed the issue.
New Developer
Posts: 35
Registered: ‎03-08-2009
My Device: Not Specified

Re: Issue with DateTimePicker not expanding correctly

Your suggestion works great.
Thanks.