Show TOC

Procedure documentationDefining Control Styles Locate this document in the navigation structure

 

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.

Prerequisites

You have added a plain text control to a form view or table view on the Layout board.

Procedure

  1. 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.

  2. Select the Style 1 text and enter a descriptive name for the style.

  3. 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 Define Expression (Define Expression) 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).

  4. 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.

    Note Note

    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.

    End of the note.
  5. 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.

  6. 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.

  7. Click the Add Style (Add Style) button and repeat steps 2 to 6 to define additional styles, as required.

  8. Use the Move Up (Move Up) and Move Down (Move Down) buttons to modify the order of the styles. At runtime, the first style in the list whose condition returns true is used.

  9. Click OK.

Note Note

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.

End of the note.