Field - ClearError Method

Clear the error

Member of Field (PRIM_MD.Input)

Details

The ClearError method sets the HasError property to false on a field and removes the error style.

The reciprocal ShowError method is used to set the error.

The HasError property can be used to test whether the field is currently in error.

Example

In this example, a UserID and Password are tested when they change.

     Begin_Com Role(*EXTENDS #PRIM_WEB) Height(672) Width(1017) 

Define_Com Class(#PRIM_MD.Edit) Name(#UserID) DisplayPosition(1) Label('UserID') Left(24) Parent(#COM_OWNER) TabPosition(1) Top(24) Height(68) Width(377) HelperText('Enter a ')
Define_Com Class(#PRIM_MD.Edit) Name(#Password) DisplayPosition(2) Label('Password') Left(24) Parent(#COM_OWNER) TabPosition(2) Top(104) Height(68) Width(377)

Evtroutine Handling(#UserID.Changed)

If (#UserID.Value.CurChars < 6)

#UserID.ShowError( 'User ID must be at least 6 characters' )

Else
#UserID.ClearError

Endif

Endroutine

Evtroutine Handling(#Password.Changed)

If (#Password.Value.IsValidPassword( Medium ))

#Password.ClearError

Else
#Password.ShowError( 'Min 6 chars, one upper|lower|number' )

Endif

Endroutine

End_Com

See also

All Component Classes

Technical Reference

  • No labels