02-14-2013 10:32 AM - edited 02-14-2013 12:13 PM
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.
Solved! Go to Solution.
02-14-2013 10:59 AM
02-14-2013 11:15 AM
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.
02-14-2013 01:00 PM
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/document
02-14-2013 03:52 PM
It works by putting it into timer to open it. Thank you.
02-14-2013 03:58 PM
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