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: 79
Registered: ‎04-04-2013
My Device: BB10 Dev Alpha Simulator
My Carrier: Blackberry

How to dislay a confirm dialog when user press on button?

Hi,

 

Lets say i have a button and i want to show a confirmation dialog when user press on it andlet user to choose yes or no then do something. Is there a way? I tried the button OnClicked with

if(confirm('Are you sure?')){

navi.push(page);

}

 

but it is not working... please help.thanks

Regards,

Steve Chan
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: How to dislay a confirm dialog when user press on button?

Hi,

 

You need to use - http://developer.blackberry.com/cascades/reference/bb__system__systemdialog.html

 

SystemDialog (const QString &confirmLabelconst QString &cancelLabelQObject *parent )

 

Regarding how to use, found a piece of code at Github - http://blackberry.github.io/Cascades-Samples/notification-dialogs-assets-main-qml.html

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 188
Registered: ‎07-19-2012
My Device: Z10 LE
My Carrier: Three

Re: How to dislay a confirm dialog when user press on button?

There's more detail about the various types of dialog available in the documentation, as well as the prerequisites to set them up. It's well worth spending half an hour of your time to read through this document properly.

 

https://developer.blackberry.com/cascades/documentation/ui/dialogs_toasts/system_dialogs.html



Did this post help you? If so, please make sure to "like" it!