Flex Form Control-TextArea Control - Adobe Flex

What is the use of textarea control in flex?

TextArea control is a text-entry control which allows the users in entering and editing multiple lines of formatted text.

Class declaration

Below is the declaration for spark.components.TextArea class:

Public properties

S.N.

Properties & Description

1

content : Object

This property is intended for use in MXML at compile time; to get or set rich text content at runtime, use the textFlow property instead.

2

heightInLines : Number

The default height of the control, measured in lines.

3

textFlow : flashx.textLayout.elements:TextFlow

The TextFlow representing the rich text displayed by this component.

4

widthInChars : Number

The default width of the control, measured in em units.

Public methods

S.N.

Method & Description

1

TextArea()

Constructor.

2

getFormatOfRange(requestedFormats:Vector.<String> = null, anchorPosition:int = -1, activePosition:int = -1):flashx.textLayout.formats:TextLayoutFormat

Returns a TextLayoutFormat object specifying the computed formats for the specified range of characters.

3

scrollToRange(anchorPosition:int = 0, activePosition:int):void

Scrolls so that the text range is visible in the container.

4

setFormatOfRange(format:flashx.textLayout.formats:TextLayoutFormat, anchorPosition:int = -1, activePosition:int = -1):void

Applies the specified formats to each element in the specified range that correspond to the given format.

Methods inherited

This class inherits methods from the following classes:

  • spark.components.supportClasses.SkinnableTextBase
  • spark.components.supportClasses.SkinnableComponent
  • mx.core.UIComponent
  • mx.core.FlexSprite
  • flash.display.Sprite
  • flash.display.DisplayObjectContainer
  • flash.display.InteractiveObject
  • flash.display.DisplayObject
  • flash.events.EventDispatcher
  • Object

Flex TextArea Control Example

Follow below steps to check usage of TextArea control in a Flex application by creating a test application:

Step

Description

1

Create a project with a name HelloWorld under a package com.wisdomjobsnt.client

2

Modify HelloWorld.mxml as explained below and skip rest of the files.

3

Compile and run the application to make sure business logic is working as per the requirements.

Below is the content of the modified mxml file src/com.wisdomjobs/HelloWorld.mxml.

After all the changes done, compile and run the application in normal mode as we did in Flex -Create Application chapter. If everything works fine with the application, this will produce below output

textarea control

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Adobe Flex Topics