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

Web and WebWorks Development

Reply
Contributor
Posts: 46
Registered: ‎05-03-2011
My Device: 9930, PlayBook
My Carrier: Verizon

Using the back button with webworks dialogs

Is there any way to cause the back button to cancel a customAsk dialog? Or maybe automatically choose a cancel option in the list of choices?

Developer
Posts: 68
Registered: ‎03-01-2011
My Device: Not Specified

Re: Using the back button with webworks dialogs

You can handle how the hard back button behaves by adding the blackberry.system.event on your config.xml file and assigning a callback function on the onHardwareKey like this :

// Assign your back button on a var
var backBtn = blackberry.system.event.KEY_BACK;

// Assign your back button with a callback function (backHandler)
blackberry.system.event.onHardwareKey(backBtn, backHandler);

// Callback once the user presses the back button
function backHandler() {
  // Perform your tasks here
}

 

You can also read about some samples through the Blackberry Webworks API here.

Highlighted
Contributor
Posts: 46
Registered: ‎05-03-2011
My Device: 9930, PlayBook
My Carrier: Verizon

Re: Using the back button with webworks dialogs

Yes, I understand that, and thank you. I was asking specifically about whether or not it is possible to use the back button to cancel a blackberry.ui.dialog.customAsk dialog.