Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Candy M. on December 05, 2008, 08:53:45 pm



Title: Would like to visually show which fields in error in INPUT
Post by: Candy M. 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


Title: Re: Would like to visually show which fields in error in INPUT
Post by: Neil M. 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.  


Title: Re: Would like to visually show which fields in error in INPUT
Post by: Sebastien F. 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