I'm developing in Ax 2012. I have stringEdit controls on a form which holds the same type of information and share an EDT. I do validation on the EDT in a class. I call the class from a check method on the form. I use the same method on the form for all the stringEdit controls that needs this validation. I kick of the check method on the form from the validate method of each control.
My question: how do I pass the control that has been modified (and needs validation) to the check method? My check method on the form looks like this:
public void checkNumber(FormStringControl _cntrl)
{
MyValidationClass valClass = new MyValidationClass();
;
if(!valClass.validateNumber(_cntrl.text()))
{
_cntrl.text("");
}
}
***the problem I have is passing the current control to the above method
The validate method on the control looks like this:
public boolean validate()
{
boolean ret;
//ret = super();
ret = element.checkNumber(this);
return ret;
}
The problem I have is passing the current control I am modifying to the checkNumber method. If I cannot pass “this” to the check method, what then should I be passing?