Start page
Start page

Start page / Template development / Rules / Form properties <PROPERTY/> / Property FOCUS

FOCUS property

Checks whether an input component is focused

The expression <PROPERTY source='gadget' name='FOCUS'/> can be used in the area Value determination of the usual definition and checks whether an input component is focused by the editor, for example, by setting the cursor in a text input field or expanding a combo box. The expression returns a Boolean value.

Examples

Warning text appears in the form if the input component is focused

In this example, a warning text appears to the editor as soon as the editor focuses on the input component “st_text”. The FirstSpirit Framework in this case returns the expression <PROPERTY source="st_text" name="FOCUS"/> TRUE. So that the validation shows a rule violation and, at the same time, the warning text appears, the expression has to be negated within the value determination.

...
<ON_EVENT>
<WITH>
<NOT>
<!-- PROPERTY Tag -->
<PROPERTY source="st_text" name="FOCUS"/>
<!-- /PROPERTY Tag -->
</NOT>
</WITH>
<DO>
<VALIDATION>
<!-- PROPERTY Tag -->
<PROPERTY source="st_text" name="VALID"/>
<!-- /PROPERTY Tag -->
<MESSAGE lang="*" text="Type &quot;Property&quot;"/>
<MESSAGE lang="DE" text="Typ &quot;Property&quot;"/>
</VALIDATION>
</DO>
</ON_EVENT>
...

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2015-01-20