Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Would like to visually show which fields in error in INPUT  (Read 9859 times)
Candy M.
Posts: 139


« on: December 05, 2008, 08:53:45 pm »

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.
Four Js
Posts: 21


« Reply #1 on: February 17, 2009, 11:24:51 am »

I do this in my demo programs:

Code
  1. ...
  2.  BEFORE INPUT
  3.     LET frm = DIALOG.getForm()
  4.  
  5.  AFTER FIELD login
  6.        IF g_sl.login IS NULL OR g_sl.login = " " THEN
  7.          CALL frm.setFieldStyle("login","invalid")
  8.        ELSE
  9.          CALL frm.setFieldStyle("login","valid")
  10.        END IF
  11. ...
  12.  

The styles are simply:
Code
  1.  <Style name=".valid">
  2.    <StyleAttribute name="backgroundColor" value="#D0F5D0"/>
  3.  </Style>
  4.  <Style name=".invalid">
  5.    <StyleAttribute name="backgroundColor" value="#F5D0D0"/>
  6.  </Style>
  7.  
Sebastien F.
Four Js
Posts: 545


« Reply #2 on: February 17, 2009, 11:40:40 am »

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
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines