Pseudo selectors

Pseudo selectors can be used to apply only when some conditions are fulfilled.

Pseudo selectors are preceded with a colon and can be combined. When combining several pseudo selectors, the style will be applied if all pseudo selector conditions are fulfilled.

<Style name="Table:even:input" >
<Style name="Edit:focus" >
<Style name="Edit.important:focus" >

Pseudo selectors have different priorities; the style with the most important pseudo selector will be used when several styles match.

Table 1. Pseudo selector description and priorities
Priority Pseudo selectors Condition
1
focus
The widget has the focus
2
query
The widget is in construct mode
3
display
The widget is in a display array
4
input
The widget is in an input array, input or construct
5
even
This widget is on an even row if an list (Table or Tree)
6
odd
This widget is on an odd row if an list (Table or Tree)
7
inactive
The widget is inactive
8
active
The widget is active
9
message
Applies only to text displayed with the MESSAGE instruction
10
error
Applies only to text displayed with the ERROR instruction
11
summaryLine
Applies only to text displayed in AGGREGATE fields of tables

Pseudo selectors also define the priority of your styles. A more generic style will be used when the pseudo-selector has a higher priority.

For instance: you want all important edits to have red text, but you want the current field to be displayed in blue:
<Style name="Edit.important" >
<Style name=":focus" >

The style ":focus" is more generic than "Edit.important"; therefore, it will be used for the focused item, as the pseudo selector is more precise.