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
Contributor
Posts: 27
Registered: ‎05-07-2012
My Device: PlayBook and Bold 9900
My Carrier: Wind
Accepted Solution

How to add HTML elements to a TextArea?

I want fo format the data to be displayed on a TextArea using HTML.

How to add HTML text formatting to a non editable TextArea?

Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: How to add HTML elements to a TextArea?

[ Edited ]

Good morning,

It is not possible to use HTML directly to modify the contents of a TextArea, however, you may apply styling using TextStyles. Note that TextStyles are only applied to the entire contents of TextAreas at once.

What is it exactly that you want to achieve?

Regards,

Martin

Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: How to add HTML elements to a TextArea?

This is actually a common situation that it would be nice to have a solution for.  Basically, you want to use rich-text stylings (and/or hyperlinking) within a block of user-displayed text, without embedding a whole browser engine (i.e. WebView).

 

The current BBOS platform makes a broken attempt at getting you half-way there with RichTextField, but there still really isn't a good solution.  It would be nice to have a component (which obviously doesn't publicly exist yet) in the Cascades API to provide something like this.

Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: How to add HTML elements to a TextArea?

dkonigs,

I can definitely see the use of what you are suggesting as a standard feature for text areas. I would recommend posting a new feature request in the Issue Tracker by following the link below:
https://www.blackberry.com/jira/secure/Dashboard.jspa

 

Thanks,

 

Martin

Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: How to add HTML elements to a TextArea?

Offo,

 

I would be interested in understanding the context of what you are trying to achieve. This could help us guide you better towards a solution that will work for you.

Martin

Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: How to add HTML elements to a TextArea?

Contributor
Posts: 27
Registered: ‎05-07-2012
My Device: PlayBook and Bold 9900
My Carrier: Wind

Re: How to add HTML elements to a TextArea?

I have to display text in which one or more words will be bold, italic or cursive depending. Also the ability to format the text with different font, size and or color. Something that can easily be accomplished using Java. This helps my app audience have a great experience instead of plain text.

Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: How to add HTML elements to a TextArea?

Hi,

Unfortunately, this cannot be done at the moment using Cascades. Depending on the nature of your application, If you require heavy use of formatting and customization, you can have a look at Webworks and use HTML5 to format text in your web application. You can have a look at WebWorks here:


https://developer.blackberry.com/html5/


Cheers,


Martin