Would like to visually show which fields in error in INPUT

Started by Candy M., December 05, 2008, 08:53:45 PM

Previous topic - Next topic

Candy M.

After validating the data in an INPUT statement, we
would like to visually show on the form all
fields that have errors.  For example,  the fields
in error could have the background color displayed in yellow.
Then, the user would know immediately which fields
need attention.

Maybe there could be an error flag that could
be set for all fields in error, then have a pseudo-selector
for the styles so you could define the decoration for
fields in error.

Or, is it possible to dynamically apply a style during
the input statement?

Thank you for any ideas.

Candy McCall

Neil M.

I do this in my demo programs:

Code (genero) Select

...
  BEFORE INPUT
     LET frm = DIALOG.getForm()

  AFTER FIELD login
        IF g_sl.login IS NULL OR g_sl.login = " " THEN
          CALL frm.setFieldStyle("login","invalid")
        ELSE
          CALL frm.setFieldStyle("login","valid")
        END IF
...


The styles are simply:
Code (xml) Select

  <Style name=".valid">
    <StyleAttribute name="backgroundColor" value="#D0F5D0"/>
  </Style>
  <Style name=".invalid">
    <StyleAttribute name="backgroundColor" value="#F5D0D0"/>
  </Style>

Sebastien F.

I believe Genero should provide a style pseudo-selector for fields in error, so that you don't have to program this in all the dialogs.
My instinct says that this is mainly a client feature, as all information is in the AUI tree (Message node with type="error", set focus to field).
Note sure... to be checked/discussed.
Seb