フィールドにエラーの設定をします
名前 | タイプ | データ タイプ | 記述 |
---|---|---|---|
ErrorText | *Input (任意) | Unicode 文字列 | 表示するテキスト |
ShowError メソッドを使って、エラーとしてフィールドを強調表示します。 ErrorText パラメータに指定したテキストは、コントロールの Helper 領域に表示されます。 相互関係にある ClearError メソッドは、エラー状態の削除に使用します。 HasError プロパティは、フィールドが現在エラーであるかどうか確認するために使用できます。
次の例では、ユーザー ID とパスワードが変更されるとチェックされます。
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
EPC142030 February 2019