Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Modal Dialogue validations not working when submitting and closing the page

NazbitSep 22 2020 — edited Sep 23 2020

Hi,

I have a page (P210) which calls a modal page (P211) through a button (redirect page in this application).

I have some validations on the modal page which work fine when my submit button has a DA with an action to submit the page.

However when I modify the DA to have two actions 1. Submit page and 2. Close Modal Dialogue the validations are no longer processed.

The dynamic action does not stop on validation error, it submits the page regardless of validation pass or fail and closes the dialogue.

I can't understand why the addition of "Close Modal Dialogue" to the DA is causing all of the validations to be ignored and page submission and post submission processing to go ahead.

The modal page has the following:

--------------

-- ITEMS x2 --

--------------

P211_Outcome

          Select List

P211_Comment

          Text Area

----------------

-- BUTTONS x2 --

----------------

B_SUBMIT_OUTCOME

           Action: Defined by Dynamic Actions

           Execute Validations: TRUE

           Server Side: None

B_CANCEL_OUTCOME

           Action: Defined by Dynamic Actions

           Execute Validations: FALSE

           Server Side: None

------------------------

-- DYNAMIC ACTIONS x2 --

------------------------

DA_SUBMIT_OUTCOME

           Event: Click

           Selection Type: Button

           Button: B_SUBMIT_OUTCOME

           Client Side: None

           Server Side: None

         

           Action - SUBMIT PAGE

                Fire when Event is TRUE

                Fire on initialisation FALSE

                Show Processing TRUE

              

           Action - CLOSE DIALOGUE

                Fire when Event is TRUE

                Fire on initialisation FALSE             

              

DA_CANCEL_OUTCOME

           Event: Click

           Selection Type: Button

           Button: B_CANCEL_OUTCOME

           Client Side: None

           Server Side: None

                   

           Action - CLOSE DIALOGUE

                Fire when Event is TRUE

                Fire on initialisation FALSE        

              

--------------------

-- VALIDATIONS x2 --

--------------------

Validate Outcome

           Type: Item is NOT NULL

          Item: P211_Outcome

          Error Message: 'Please select an outcome'

          Display Location: Inline with field

          Associated Item: P211_Outcome

          Always Execute: FALSE

          Server Side: None

        

Validate Comment

     Type: PL/SQL Function Returning Error Text

          Display Location: Inline with field

          Associated Item: P211_Comment

          Always Execute: FALSE

          Server Side: None        

-- Validate Comment PL/SQL Function

IF :P211_DISPOSITION_OUTCOME = 'Accept With Comments'

     AND :P211_DISPOSITION_NOTES IS NULL

    THEN

  

           RETURN 'To accept with comments please enter a comment in the notes field';

ELSE

        RETURN NULL;

      

END IF;

-------------------

-- PROCESSING x1 --

-------------------

Update Investigation Outcome  

          Type: PL/SQL Code

          Source: Local Database

          Execution Point: After Submit

          Run Process: Once Per Page Visit

          PL/SQL Code: this is just an update statement to append these two attributes to an existing row

          Server Side: None

The cancel button works just as I'd like and closes the page without submitting or validating.

The Submit button works until I add the close modal step to the DA. If I remove that step then all validations work again.

Does anyone know how to solve this or what I have done wrong?

Thanks

Oracle Database 18c Express Edition Release 18.0.0.0 Production

Apex Release 20.1.000.13

ORDS 19.2.0.r1991657

Message was edited by: Nazbit to add Oracle and Apex versions

This post has been answered by fac586 on Sep 22 2020
Jump to Answer
Comments
Post Details
Added on Sep 22 2020
2 comments
2,587 views