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
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -
Accepted Solution

SystemDialog - onFinished: not working since Gold Beta

Hi out there,

 

I have a problem. SystemDialog has stopped working at my code:

 

SystemDialog {
                id: testDialog
                title: "myApp"
                body: "Testmessage"
               
                onFinished: {
                    if (testDialog.result == SystemUiResult.ConfirmButtonSelection) {
                        logic.Test();
                    }
                }
            }

 

There are 2 Buttons at this Dialog. Ok and Cancel. But even if I remove the if () {} to get the pressed button, at the onFinished block, the code inside isn't called.

 

Was onFinished renamed?

 

It worked at the Beta4 just fine.

 

Please use plain text.
Developer
strobejb
Posts: 276
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: SystemDialog - onFinished: not working since Gold Beta

[ Edited ]

SystemDialog works ok for me in GC

 

in your onFinished handler, try checking for result instead of test.result   (that's what my code does, which I just checked works). Also try adding:

 

confirmButton.label: qsTr("button label")
confirmButton.enabled: true

 

https://developer.blackberry.com/cascades/reference/bb__system__systemdialog.html#finished

 

Please use plain text.
Developer
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

Re: SystemDialog - onFinished: not working since Gold Beta

I changed a lot in my code but even if I write

   onFinished: {
                        logic.Test();
                }

 it doesn't work. The OnFinished: Handler isn't called. If I put the logic.Test(); line in a onClicked from a Button it works just fine.

 

Thats strange. :Boat:

Please use plain text.
Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry
My Carrier: Vodafone

Re: SystemDialog - onFinished: not working since Gold Beta

Yup, it's also not working for me. finished signal is never emitted.

 

Regards,

Nishant Shah

Please use plain text.
Developer
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

Re: SystemDialog - onFinished: not working since Gold Beta

_NishantShah, have you found in the meantime a solution?

Please use plain text.
Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry
My Carrier: Vodafone

Re: SystemDialog - onFinished: not working since Gold Beta

not really, I might replace it with CustomDialog, if it isn't resolved soon.

 

Regards,

Nishant Shah

Please use plain text.
Developer
strobejb
Posts: 276
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: SystemDialog - onFinished: not working since Gold Beta

I'm still not seeing any issues with any of the Systemxxx dialogs & toast  (Gold Candidate SDK)

 

This is what I have for my SystemDialog:

 

// FileListing.qml
include bb.cascades 1.0
include bb.system 1.0

Page { ..... attachedObjects: [ SystemDialog { id: deletePrompt property variant fileObject // custom property so I know what to delete title: "Delete" body: "Delete selected file?" confirmButton.label: qsTr("Delete") confirmButton.enabled: true cancelButton.label: qsTr("Cancel") cancelButton.enabled: true onFinished: { if (result == SystemUiResult.ConfirmButtonSelection) { _myapp.delete_object(fileObject); } } } ] }

 

It's in a separate QML file that is included as as ComponentDefinition in my main.qml but I doubt that makes any difference.

 

Here is how I show it:

 

function showDeleteDialog(fileObject) {

    deletePrompt.listItem = fileObject;
    deletePrompt.body = "Delete \"" + fileObject.title + "\" ?";
    deletePrompt.show();

}

 

Note that I've defined a custom property in the SystemDialog to keep track of my FileObject class that I export to QML from C++

 

 

Please use plain text.
Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry
My Carrier: Vodafone

Re: SystemDialog - onFinished: not working since Gold Beta

Do we have to explicitly enable confirmButton & cancelButton?

Please use plain text.
Developer
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

Re: SystemDialog - onFinished: not working since Gold Beta

[ Edited ]

_NishantShah wrote:

Do we have to explicitly enable confirmButton & cancelButton?


No, at least not over here. No difference by enabling the buttons. They are visible by the default. The dialog ist shown as expected, I'm able to rename the Button Labels... but whatever I set, onFinished: {} isn't called. 

Worked just great at Beta 3.

Please use plain text.
Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry
My Carrier: Vodafone

Re: SystemDialog - onFinished: not working since Gold Beta

helex, this is really crazy. I did manage to find the cause of the issue. Remove SystemToast from qml if you have used any. It worked for me. Hope it does for you too.

 

Regards,

Nishant Shah

Please use plain text.