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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
New Contributor
aaronjylee
Posts: 7
Registered: ‎10-03-2012
My Carrier: Bell
Accepted Solution

New line in xml?

I'm calling this method

blackberry.ui.dialog.customAskAsync(blackberry.app.license, buttons, this.dialogCallBack, ops);

And within my config.xml, I have a <license> element where I've put my EULA.

I've tried \n and &#xA; , but both doesn't seem to create a new line when the dialog comes up. How should I create a new line?

Thanks!

Please use plain text.
BlackBerry Development Advisor
anzor_b
Posts: 76
Registered: ‎09-24-2012
My Carrier: Bell

Re: New line in xml?

Hi aaronjylee, I've tested some other methods, but no success. This is because javascript reads the license element data as a string.

Please use plain text.
Developer
jamesgibbons
Posts: 26
Registered: ‎06-01-2010

Re: New line in xml?

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

___________________________________________________________
My latest Blackberry 10 app Audiobooks! :smileyhappy:

My latest PlayBook app Photojam!

Find me on Twitter: GoGibbons
Please use plain text.
BlackBerry Development Advisor
erikjohnzon
Posts: 232
Registered: ‎09-21-2012
My Carrier: Virgin

Re: New line in xml?

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-WebWorks-Framework/tree/next-testHTML5Dialog

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.