
You can use styles to change the colors of text in a plain text control, based on defined conditions. For example, you may want to display information in red if a quantity is over a certain value, or green if it is below a certain value. If the plain text control is in a table view, you can also define a background color for the table cell that contains the plain text control.
You have added a plain text control to a form view or table view on the Layout board.
On the Layout board, right-click the plain text control whose styles you want to define and choose Styles .
The Define Styles dialog box is displayed.
Select the Style 1 text and enter a descriptive name for the style.
In the
Condition cell of the first row, enter a dynamic expression that defines when to apply the style. To do this, you can click the
button
and use the
Dynamic Expression Editor dialog box. For more information, see
Working with Dynamic Expressions . Alternatively, you can leave the default condition (
true )
to indicate that the style is always used (not conditional on certain criteria).
If the plain text control is in a table, in the Cell Background cell, choose the color for the cell. The background color that you select is displayed as the background color of the Style cell.
The available colors are defined in Web Dynpro themes, and the actual color of each theme item may change at runtime depending on the current Web Dynpro theme definitions.
In the Font Style cell, choose the text format. The font style that you select is displayed as the font style of the Style cell.
In the Text Color cell, choose the color for the text. The color that you select is displayed as the text color of the Style cell.
Click the
button and repeat steps 2 to 6 to define additional styles, as required.
Use the
and
buttons
to modify the order of the styles. At runtime, the first style in the list whose condition returns
true is used.
Click OK .
If you are defining styles for a plain text control in a table view, you can click the Define row styles link in the Define Styles dialog box to display the Define Row Styles dialog box and define the row styles, or click the View Row Styles link to display the already-defined row styles.