AddControl (add managed control )

Top  Previous  Next

 

AddControl( feq,action )

AddControl

Adds a control to the controls queue so that a specified action is taken when any rule in the managed collection is broken.

feq

A numeric constant, variable, EQUATE, or expression that indicates the Field Equate number of a control whose hidden or disabled status will be determined by the existence of one or more broken rules.

action

A numeric constant, variable, EQUATE, or expression that indicates the action to be taken with respect to this control when a rule is broken, defined as follows:

 

RuleAction:None

EQUATE(0)

RuleAction:Hide

EQUATE(1)

RuleAction:UnHide

EQUATE(2)

RuleAction:Disable

EQUATE(3)

RuleAction:Enable

EQUATE(4)

Example:

 Customer.SetErrorImage('~BRuleNo.ico')

 Customer.SetDescription('Customer File Rules')

 Customer.AddRule('StateRequired','State is required','cus:State <<> ''''',?cus:State,3)

 Customer.AddRule('ZipOK','Postal code must have valid format.',

                  'CheckCustomerZip()',?cus:ZipCode,3)

 Customer.AddRule('CreditLimit','Credit limit must not exceed $1000.00',

                  'cus:CreditLimit =<< 1000',?cus:CreditLimit,3)

 Customer.AddControl(?Ok,RuleAction:Disable) ! Disable OK button if any rule broken