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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
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
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
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
Developer
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
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

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
Developer
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
Developer
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