5 Replies Latest reply: May 2, 2013 5:15 AM by Anthony Rayner-Oracle RSS

    Dynamic Action  - True Action -> Confirm, Cancel Option is still submitting

    Dila
      Hi,

      my problem is, i have a dynamic action with true action "confirm" but if i click "cancel" the page is still submitting.

      event: click
      selection type: jquery selector
      jquery selector: .checkLimit
      condition: javascript expression

      value :isPULimitReachedForAll();


      true action: confirm

      so, if the user clicks "cancel" i want to abort and NOT to submit . please help !!
        • 1. Re: Dynamic Action  - True Action -> Confirm, Cancel Option is still submitting
          Hari_639
          Dila wrote:
          Hi,

          my problem is, i have a dynamic action with true action "confirm" but if i click "cancel" the page is still submitting.

          event: click
          selection type: jquery selector
          jquery selector: .checkLimit
          condition: javascript expression

          value :isPULimitReachedForAll();


          true action: confirm

          so, if the user clicks "cancel" i want to abort and NOT to submit . please help !!
          What will be selected with jQuery Selector +.checkLimit+ ? Is it APEX Button or Link or What-else?

          Do you have any other D.A. that will fire when you click elements with class checkLimit?

          Regards,
          Hari
          • 2. Re: Dynamic Action  - True Action -> Confirm, Cancel Option is still submitting
            Anthony Rayner-Oracle
            Hi Dila,

            Would you be able to answer the following:
            1) APEX version?
            2) Browser version?
            3) Does your 'Cancel' button have an 'Action when button clicked' of 'Defined by Dynamic Action'?
            4) Are you able to provide a reproducing test case on apex.oracle.com?

            Regards,
            Anthony
            • 3. Re: Dynamic Action  - True Action -> Confirm, Cancel Option is still submitting
              Dila
              .checkLimit is a button. the function isPULimitReachedForAll() checks if the value in a textfield is > than 9.
              if yes, the true action fires where i can choose if the page has to be submitted or not. if not(click cancel) , it is submitting, but i want to cancel

              i'm using 4.2.1.00.08
              and the problem is happening in chrome and internet explorer
              • 4. Re: Dynamic Action  - True Action -> Confirm, Cancel Option is still submitting
                Dila
                3) Does your 'Cancel' button have an 'Action when button clicked' of 'Defined by Dynamic Action'?

                no it doesn't ! i expect that the "cancel" action has to stop my transaction.
                • 5. Re: Dynamic Action  - True Action -> Confirm, Cancel Option is still submitting
                  Anthony Rayner-Oracle
                  If your button is a button that submits, then unless you have defined your DA as 'Before Page Submit' (which you haven't), then the submit will still proceed, as you have found. There is also a problem with use of 'Before Page Submit' in APEX 4.2.1, which I will come onto. Therefore, I believe you should try the following:

                  1) Change your button to be 'Defined by Dynamic Action'.
                  2) Add an additional action to your DA, that fires after your 'Confirm' and does a 'Submit Page'. Set the 'Request / Button Name' to the name of the button (this ensures your page processing still work the same as before, and also by setting the request value equal to the button name, the button's 'Exexute Validations' property is respected).

                  If the user cancels, DA processing will stop and the submit will not proceed, if the user confirms, then DA processing continues and therefore the submit will proceed.

                  Theoretically, there is an alternative approach to this as mentioned earlier, where upon you could stick with a button that submits, and then utilise the DA's 'Before Page Submit' event type, where upon a cancelled 'Confirm' defined in a DA using that event would also prevent page submission. However there is a bug with IE and Firefox in 4.2.1 (fixed in 4.2.2), that means the page will incorrectly redirect to a blank page just showing the text 'false' on cancel. So I would stick with the approach outlined above for 4.2.1.

                  Hope this helps.

                  Anthony.

                  PS: Is your button a standard APEX button? If so, I would switch your DA When declaration to just select 'Button' and then select your button. This will be faster than a full page class selector and a cleaner approach, because you can just the built-in capability of APEX and are not reliant on a class to identify a single button.

                  Edited by: Anthony Rayner on May 2, 2013 11:14 AM