If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Developer
jeswinsimon
Posts: 63
Registered: ‎11-12-2012
My Device: BB10 DevAlpha
My Carrier: Airtel

Custom Background and HTML formatting for text area.

I have a text area for user input in my application. Is it possible to format the text in the textarea using HTML?

I tried using 

text: "HTML CODE"

 but it formats only the existing text and not the new ones entered by the user.

Also I would like to have a custom background for the text area which scrolls along with the text. Is it possible?

Click Accept as Solution if this post that have solved your issue(s)!
Like if you found this post useful..
Please use plain text.
Developer
saprykin
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: Custom Background and HTML formatting for text area.

It supports only reduced number of HTML features - use textFormat property to enable it.
To make custom background just add your text area to Container and set container's background to whatever you want.
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Please use plain text.
Developer
jeswinsimon
Posts: 63
Registered: ‎11-12-2012
My Device: BB10 DevAlpha
My Carrier: Airtel

Re: Custom Background and HTML formatting for text area.

But then the background will be static. I want the background to scroll relative to the textArea.
Click Accept as Solution if this post that have solved your issue(s)!
Like if you found this post useful..
Please use plain text.
Developer
saprykin
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: Custom Background and HTML formatting for text area.

You can try to track scroll position changes and set background dynamically depending on that.
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Please use plain text.
Developer
jeswinsimon
Posts: 63
Registered: ‎11-12-2012
My Device: BB10 DevAlpha
My Carrier: Airtel

Re: Custom Background and HTML formatting for text area.

Using JavaScript?
Click Accept as Solution if this post that have solved your issue(s)!
Like if you found this post useful..
Please use plain text.
Developer
saprykin
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: Custom Background and HTML formatting for text area.

I'm not good at QML and JS :smileysad: If I was implementing such a functionality, I will create a custom control.
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Please use plain text.
Developer
jeswinsimon
Posts: 63
Registered: ‎11-12-2012
My Device: BB10 DevAlpha
My Carrier: Airtel

Re: Custom Background and HTML formatting for text area.

Even I'm a newbie :smileysad: Any idea how to create a custom control?
Click Accept as Solution if this post that have solved your issue(s)!
Like if you found this post useful..
Please use plain text.
Developer
saprykin
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: Custom Background and HTML formatting for text area.

Take a look at this example: https://developer.blackberry.com/cascades/documentation/dev/integrating_cpp_qml/custom_control_tutor...
And for QML one: https://developer.blackberry.com/cascades/documentation/ui/custom_components/custom_components_tutor...
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Please use plain text.