Show TOC Start of Content Area

Object documentation Text View  Locate the document in its SAP Library structure

Definition

A multiline region for displaying text. Text in the control is restricted to a single font, size and style unless set with HTML commands.

·        design

Defines the appearance of the text. Design can be set to "HEADER1", "EMPHASIZED", "LABEL" and so on. The CSS controls how the different options get rendered. The following description is based on the standard CSS delivered.

¡         This graphic is explained in the accompanying text

Bold text, text size STANDARD

¡        This graphic is explained in the accompanying text

Bold text, text size +4 in comparison to STANDARD

¡        This graphic is explained in the accompanying text

Bold text, text size +2 in comparison to STANDARD

¡        This graphic is explained in the accompanying text

Bold text, text size STANDARD

¡        This graphic is explained in the accompanying text

Text size and attributes STANDARD

¡        This graphic is explained in the accompanying text

Text size -2 in comparison to STANDARD

¡        This graphic is explained in the accompanying text

Italic text, text size STANDARD

¡        This graphic is explained in the accompanying text

No text attributes and standard text size

·        encode

A boolean value that defines how the text is interpreted. HTML text formatting commands (for example, <h1>, <i> etc.) can be used to change the display of the text. If there are no formatting commands in the text string, the encode attribute has no effect.

Example:

text="<h1><i>Important</i></h1>"

encode = "false"     Browser output: This graphic is explained in the accompanying text

the text string is rendered by interpreting the formatting commands.

 

encode = "true"      Browser output: This graphic is explained in the accompanying text

the formatting commands are displayed and not interpreted.

·        hoverMenuId

Defines which hover menu is displayed for this tree node. You can define different trigger methods to display the hover menu. For more details, see hover menu.

·        id

Identification name of the text.

·        labeled

Enables or disables the notification when the control has a label assigned to it.

·        layout

Defines the alignment of the text.

¡        BLOCK

Renders the textView with a <div> HTML tag.

¡        NATIVE

Renders the textView with a <span> HTML tag.

¡        PARAGRAPH

Renders the textView with a <p> HTML tag

·        required

Deprecated - the control 'label' should be used instead to label required input fields.

A boolean value. If set to "true" an asterisks (*) in red color is placed at the end of the text string. This is a common method to indicate that input is required. See also inputField and label.

·        text

Defines the string of text displayed. See 'encode' for a formatting example with embedded HTML commands.

·        tooltip

Defines the hint of the textView which is displayed as the mouse cursor passes over the textView, or as the mouse button is pressed but not released.

·        width

Defines the width of the textView. The width shows only effect when the 'wrapping' attribute is set to "true". Otherwise the width and layout follows the HTML commands in the text string.

·        wrapping

A boolean value. If set to "true" the text is word wrapped at the set 'width' or - if no 'width' is set - at the form width.

 

Attributes

M

Values

Usage

design

 

EMPHASIZED
HEADER1
HEADER2
HEADER3
LABEL
LABELSMALL
LEGEND
REFERENCE
STANDARD
EMPHASIZED
HEADER1
HEADER2
HEADER3
LABEL
LABELSMALL
LEGEND
REFERENCE
STANDARD (d)

Taglib
design="HEADER1"

Classlib
setDesign(TextViewDesign.HEADER1)

encode

 

FALSE
TRUE (d)

Taglib
enabled="FALSE"

Classlib
setEnabled(false)

hoverMenuId

 

String (cs)

Taglib
hoverMenuId="textHover1"

Classlib
setHoverMenuId(textHover1)

id

*

String (cs)

Taglib
id="Intro_text"

Classlib
setId("Intro_text")

labeled

 

FALSE (d)
TRUE

Taglib
No tag available

Classlib
setLayout(TextViewLayout.BLOCK)

required
Deprecated

 

FALSE (d)
TRUE

Taglib
required="TRUE"

Classlib
setRequired(true)

text

 

String

Taglib
text="PDK introduction"

Classlib
setText("PDK introduction")

tooltip

 

String

Taglib
tooltip="PDK document"

Classlib
setTooltip("PDK document")

width

 

Unit (100%)

Taglib
width="300"

Classlib
setWidth("300")

wrapping

 

FALSE (d)
TRUE

Taglib
wrapping="TRUE"

Classlib
setWrapping(true)

 

Example

using the taglib

  <hbj:textView
      id=
"Text_ZIP"
      
text="ZIP Code"
      
design="EMPHASIZED"
  
/>

 

using the classlib

    Form form = (Form)this.getForm();
    TextView tv2 = 
new TextView("tv2");
    tv2.setText(
"ZIP Code");
    tv2.setDesign(TextViewDesign.EMPHASIZED);
    form.addComponent(tv2);

 

Result

This graphic is explained in the accompanying text

 

 

End of Content Area