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
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All
Accepted Solution

Custom Dialog could not be shown at the event of "onCreationCompleted"

[ Edited ]

My application has a "Disclaimer" dialog which should be shown when the app is launched. There are two options on it. If the users don't agree the disclaimer, the app will be closed. I put it into the onCreationCompleted event handler at the first screen but it could not be shown through there. But I have tested to click a button to open it, it can be shown properly.

 

I also tried with System dialog, it can be shown at the event of onCreationCompleted properly. But I could not use it cause my disclaimer dialog has a complicated UI design.

 

attachedObjects: [	            
    CDialogDisclaimer {
        id: cddisclaimer                 
    }
]

onCreationCompleted: {	
try { cddisclaimer.open(); //Checked the log, no error, just could not show
} catch (error){
     console.log("custom dialog error:"+error.message);
    } }

 

 

Does someone know how to resolve this issue?

 

Thank you.




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
simon_hain
Posts: 15,868
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Custom Dialog could not be shown at the event of "onCreationCompleted"

put it in a try/catch block to see if there are any errors.
a few console.log statements also help.
----------------------------------------------------------
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
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Custom Dialog could not be shown at the event of "onCreationCompleted"

Thank you for your reply. I tried to add try and catch, but there is still no error shown and the custom dialog can not be shown.




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
Zmey
Posts: 1,510
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Custom Dialog could not be shown at the event of "onCreationCompleted"

Hi,

 

That's very strange. Could you try to open it from QTimer's onTimer handler?

Try setting a big interval first, then if it works set it to 0 msec.

 

This page has a code snippet for starting the timer in QML (search for "QTimer"):

https://developer.blackberry.com/cascades/documentation/dev/integrating_cpp_qml/index.html


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Custom Dialog could not be shown at the event of "onCreationCompleted"

It works by putting it into timer to open it. Thank you. 




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Custom Dialog could not be shown at the event of "onCreationCompleted"

I actually thought out another solution. Add a full screen of container same as the custom dialog UI with transparent background into the first screen, and set visible of container to true or false in order to looks like open a dialog or close a dialog. Because it covers the whole screen, so that only the buttons within it can has response. It also looks like a custom dialog. lol




p(^_^)q
Good good study, day day up
Please use plain text.