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
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,019
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 ??
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