10-05-2012 02:33 PM
I'm calling this method
blackberry.ui.dialog.customAskAsync(blackberry.app
And within my config.xml, I have a <license> element where I've put my EULA.
I've tried \n and 
 , but both doesn't seem to create a new line when the dialog comes up. How should I create a new line?
Thanks!
Solved! Go to Solution.
10-13-2012 02:22 PM
Hi aaronjylee, I've tested some other methods, but no success. This is because javascript reads the license element data as a string.
10-13-2012 03:03 PM
One way to prompt the user for a license agreement at application start is to just save the license as a string in JavaScript with "\n" for new lines instead of using blackberry.app.license in config.xml. Here is an example:
var title = "Application License Agreement";
var message = "Line 1\nLine 2\nLine 3\nLine 4";
var buttons = ["I Agree", "I Disagree"];
var ops = {
title : title,
size : blackberry.ui.dialog.SIZE_SMALL,
position : blackberry.ui.dialog.CENTER
};
var callback = function (result)
{
if (result == 0)
{
// user agreed
alert("Glad you agreed.");
}
else if (result == 1)
{
// user disagreed
alert("Sorry you didn't agree. Closing the app now.");
blackberry.app.exit();
}
};
blackberry.ui.dialog.customAskAsync(message, buttons, callback, ops);
Cheers,
James
10-15-2012 10:24 AM
This will be solved in the upcoming release of WW. You will be given the ability to send HTML to a dialog, which will give you the ability to control more of your content. You can keep an eye on some of the developments by Daniel here:
https://github.com/blackberry-webworks/BB10-WebWor