Menu

Tabular form Validation

Help
2008-06-05
2013-04-22
  • John Peters

    John Peters - 2008-06-05

    Hello,

    i have installed version 1.6 of the apexlib and have a problem with the validation of a tabular form.
    What i have done:
    - created a tabular form on the EMP table
    - added a (dummy) validation to make sure that if the name of the employee is 'KING' his job is 'PRESIDENT'
      * Page level validation
      * Type 'Function returning Error Text'
      * Error Display Location 'On error Page'
      * Validation Expression:
        BEGIN
          FOR ii IN 1 .. ApexLib_TabForm.getRowCount LOOP
             IF ApexLib_TabForm.hasRowChanged(ii) THEN
                 IF ApexLib_TabForm.V('ENAME', ii) = 'KING' THEN
                    IF ApexLib_TabForm.V('JOB', ii) <> 'PRESIDENT' THEN
                     ApexLib_Error.addError
                       ( pError      => 'King must be president'
                       , pColumnName => 'ENAME'
                       , pRow        => ii
                       );
                    END IF;
                 END IF;
             END IF;
          END LOOP;
          RETURN ApexLib_Error.getErrorStack;
        END;

    When i add a new row with name 'KING' and job 'CLERK' with Error Display Location 'Inline with field and in Notification', the error is shown, but the row i have added is removed.
    If i change the Error Display Location to 'On error Page', the row stays, but the error isn't shown.

    If i create the error when updating an existing row, i don't see the eror but when i do the same in debug mode, i see:
    .03: Perform validations:
    0.03: ...PL/SQL "function body returning error text" Validation: BEGIN FOR ii IN 1 .. ApexLib_TabForm.getRowCount LOOP IF ApexLib_TabForm.hasRowChanged(ii) THEN IF ApexLib_TabForm.V('ENAME', ii) = 'KING' THEN IF ApexLib_TabForm.V('JOB', ii) <> 'PRESIDENT' THEN ApexLib_Error.addError ( pError => 'King must be president' , pColumnName => 'ENAME' , pRow => ii ); END IF; END IF; -- END IF; END LOOP; -- RETURN ApexLib_Error.getErrorStack; END;
    0.05: Show ERROR page...
    0.05: Performing rollback...
    error occured
    Row 4: King must be president
    OK

    Can someone help me with this problem?

     
    • John Peters

      John Peters - 2008-06-05

      Update:

      When i get an error from the database, this is also not shown.
      But when i'm running in debug mode, the error is shown!

      Maybe this helps finding the problem.

       

Log in to post a comment.