문제

대부분의 경우 부모 필드가 변경 될 때마다 두 번 실행합니다. 모든 것이 여전히 작동하지만 Infolog는 매번 이중 메시지를 표시합니다.

이것을 막을 방법이 있습니까?

감사

public boolean validate()
{
    boolean ret;
    int exlowValue;
    int lowValue;
    int highValue;
    int exhighValue;
    str errorMessage;
    ;

    ret = super();

    //Make sure a numeric value was entered
    if (ABC_RegExValidator::validateMe("integer",  int2str    (ABC_Checks_checkExtremeLow.value())))
    {
        //get the form values
        exlowValue = ABC_Checks_checkExtremeLow.value();
        lowValue = str2int(ABC_Checks_checkLow.valueStr());
        highValue = str2int(ABC_Checks_checkHigh.valueStr());
        exhighValue = str2int(ABC_Checks_checkExtremeHigh.valueStr());

        //Extreme Low must be 0 or less than all others
        if (exlowValue != 0)
        {
            //A non-zero value was entered; it must be less than all other fields
            if ((exlowValue >= lowValue && lowValue > 0) || (exlowValue >= highValue && highValue > 0) || (exlowValue >= exhighValue && exhighValue > 0))
            {
                //Return an error
                ret = checkfailed(strFmt("@ABC197", int2str(exlowValue)));
            }
            else
            {
                //Not greater than any other value
                //Success!
                ret = true;
            } //Greater than all others?
        }
        else
        {
            //No errors
            ret = true;
        } // 0?
    }
    else
    {
        //Regular expression failed
        //Return an error
        ret = checkfailed("@ABC192");
    } //Regular expression


    return ret;
}
도움이 되었습니까?

해결책

문제에 대한 설명은 실제로 명확하지 않습니다. 양식 컨트롤에서 Valite 메소드, 양식 데이터 소스의 Validate 메소드 및 테이블의 ValiteField 메소드를 무시할 수 있습니다. 그것이 버전 3.0에 대한 나의 지식입니다. 그리고 "부모 필드"를 무슨 뜻입니까? 나는 테이블 필드를 추정합니까?

각 메소드에 정보 메시지를 넣으면 값을 수정할 때만 한 번만 실행됩니다. 3.0의 경우입니다. 어떤 버전을 사용하고 있는지 모르겠습니다.

어쩌면 어떤 검증 방법에 대해 더 정확할 수 있습니까?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top