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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Regular Contributor
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user
My Carrier: Airtel

launch date picker from click of a button

Hi Already i know there is a date picker component in cascades ui library but is there any possibility we can open a date picker from a button click !!

 

Regards,

Neo!!

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: launch date picker from click of a button

the DateTimePicker is a ui component. You can have a ComponentDefintion with one, create it on the buttonClick and add it to a container, for example.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user
My Carrier: Airtel

Re: launch date picker from click of a button

Thanks for your reply how should i do that:

 

ComponentDefinition {

 Source ?? Content ??

}


Any small clue will be helpful !!

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

Re: launch date picker from click of a button

Hi,
Why do you want to open it on button click? It works like a button itself. If you want to show or hide it, simply change the 'visible' property on button click:

datePickerId.visible = !datePickerId.visible

Where datePickerId is the id of DateTimePicker.

Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: launch date picker from click of a button

[ Edited ]
ComponentDefinition{
    id: dynamicPicker
    source: "MyPicker.qml"
}


Button{
id: blabla
onClicked{
var picker = dyanmicPicker.createObject()
// And now do what you want with picker.....
}
}

   

You can also hide picker and on button click show it Smiley Wink

 

EDIT:

My post was sended two times. Sorry admins/mods 

 

As say @zmeyc Pickers are clickable so you can just Hide it, but do what you want Smiley Wink



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Regular Contributor
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user
My Carrier: Airtel

Re: launch date picker from click of a button

Sorry but how can i link ComponentDefinitiion of DateTimePicker ??

Regular Contributor
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user
My Carrier: Airtel

Re: launch date picker from click of a button

Thanks all for your answers but it seems you all got me wrong:

1. I want this because i have a custom button with different color and schemes, text and i want to show date picker when i click that button.

2. I dont have any mypicker.qml i want to use the Cascades DatePicker component can i use that with ComponentDefinition ??
Highlighted
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: launch date picker from click of a button

Alas, it's not customizable. It's not possible to show only the dropdown portion.

Andrey Fidrya, @zmeyc on twitter