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
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
Accepted Solution

Read result of a SystemDialog in QML

I have a SystemDialog as an attached object in QML:

attachedObjects: [
  SystemDialog {
   id: dialog
  }
}

 I want to read the result (ok or cancel pressed):

 

dialog.title = "some text"
dialog.body = "more text"
var result = dialog.exec();
console.log("dialog result: " + result);

In my main app i included the types:

 

qmlRegisterType<SystemDialog>("bb.system", 1, 0, "SystemDialog");
qmlRegisterUncreatableType<SystemUiResult>("bb.system",1,0,"SystemUiResult", "");

 Still, console.log gives me undefined as a result. What am i missing?

----------------------------------------------------------
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
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Read result of a SystemDialog in QML

I found a workaround:
if (dialog.buttonSelection() == dialog.confirmButton){
...
----------------------------------------------------------
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