9 Replies Latest reply on Oct 13, 2011 8:49 AM by FrankBohlken

    Problem with DYNAMIC ACTION CONFIRM maybe a bug

    FrankBohlken
      Hi All,

      My problem
      I have a timer problem.
      The parameter that i used for the function on the DB don't gets the right value. It using the artikel_id from the former action of the user.
      For example:
      - User brings back 2 artikels. Artikel A and B
      - Scanning first artikel A where i except a confirm message there is no message. I see artikel_id(empty) on screen but not used as parameter (wrong)
      - When scanning for second time artikel A there will be a confirm message, I see artikel_id(A) also used as parameter (right)
      - When scanning for third time artikel B there will be also confirm message, wher i except no confirm message, I see artikel_id(A) also used as parameter. (wrong)

      Except to solve this by executing a dynamic action execute PL/SQL action to submit page item artikel_id before the confirm dyn action.
      But it didn't
      What did i wrong.
      I do not understand why the artikel_id uses the old value.

      I looked in book Expert Oracle Application Express and followed the right procedure still it doesn' t work.
      Is this maybe a bug?

      Greetings Frank
        • 1. Re: Problem with DYNAMIC ACTION CONFIRM maybe a bug
          FrankBohlken
          Hi,
          Has nobody an idea?

          Gr. Frank
          • 2. Re: Problem with DYNAMIC ACTION CONFIRM maybe a bug
            Anthony Rayner-Oracle
            FrankB,

            I think an example on apex.oracle.com would help to answer this. Could you put something up there and provide credentials? Also, what version of APEX are you using?

            Regards,
            Anthony
            • 3. Re: Problem with DYNAMIC ACTION CONFIRM maybe a bug
              FrankBohlken
              Hi Anthony,

              My credentials are Application Express 4.0.1.00.03

              Working on example on www.apex.oracle.com

              Gr. Frank
              • 4. Re: Problem with DYNAMIC ACTION CONFIRM maybe a bug
                FrankBohlken
                I made an example on http://apex.oracle.com
                Workspace = fbo_demo
                user = demo
                pp= demo

                In Page 8 = Transactions problem dynamic actions da_confirm

                In page 7 = Article you can see article are in possession by which customer

                In my own application there a difference in behaviour. In my page there isn't a page reset in this example there is.
                Tried to show the value before the confirm action as executed in an alert message with &P8_article_id. and &P8_cust_customer_id. the stay empty why?


                Question:
                Actually what i want to do is a validation in DB and as result want to show a confirm or not is there also a solution to do this in the Page Processing by Validations?
                Best option would be: You can also choose in validation by Error message display location for besite: inline, notification, error page ALSO FOR the option: ALERT message or CONFIRM message.


                Gr. Frank

                Edited by: Frank Bohlken on 23-sep-2011 11:57
                • 5. Re: Problem with DYNAMIC ACTION CONFIRM maybe a bug
                  Anthony Rayner-Oracle
                  Hi,

                  Instead of allowing the selection of an article that does not correspond to the selected customer, how about using a cascading list of values to only present valid articles to the user, upon selection of different customers?
                  http://download.oracle.com/docs/cd/E23903_01/doc/doc.41/e21674/bldapp_item.htm#CHDJDADC

                  You could then also add a Page Processing > Validation to protect this server side, when the page gets submitted (in case a cunning user tries to use an article ID they're not supposed to).

                  How does that sound?

                  And by the way, there is (currently) no easy way to refer to the updated page item value in the built-in ;'Confirm' action using the &P1_MYITEM. syntax. This will only pick up the values when the page loads, not as they've been updated to by the user on the page. You could definitely code your own confirm in an 'Execute JavaScript Code' action, pulling in the item values using the $v('P1_MYITEM') JavaScript function, but first let's see what you think of my suggested approach above.

                  Regards,
                  Anthony.
                  1 person found this helpful
                  • 6. Re: Problem with DYNAMIC ACTION CONFIRM maybe a bug
                    FrankBohlken
                    Hi Antony,

                    Thanx for your quick response.
                    The problem is the customer is allowed to do this action he need only get a warning.
                    That's why i want to use a confirm when customer presses OK then changes will be commit when press Cancel no commit.
                    I was aware of that &P1_MYITEM. only refreshes on pageload.
                    But in the boolean function i use :P1_MYITEM I thought that on this items it is possible to do a refresh.
                    You see that behaviour with the refresh in the article in possession block when you change customer

                    Greetings,
                    Frank
                    • 7. Re: Problem with DYNAMIC ACTION CONFIRM maybe a bug
                      FrankBohlken
                      Hi Everybody,

                      I tried a different solition path.
                      I made a validation with my function
                      and put in error message somthing like this:
                      See workspace: fbo_demo
                      user: demo
                      pp: demo

                      <script>
                      $(function(){
                      $("<div/>",{
                      "html":"Article with &P8_CUSTOMER_ID. is in possession of other customer still want to have it?."
                      }).attr({"title":"Warning!"}).dialog({
                      modal:true,
                      buttons: {
                      'Oke': function() {
                      $(this).trigger('submit');
                      },
                      Cancel: function() {
                      $(this).dialog('close');
                      }
                      }
                      })
                      })
                      </script>

                      Now i have also a confirm but hopefully at with the good timing.
                      Other problem with the above script is submit doe not work.
                      Maybe because Apex noticed the error and will not submit.

                      Can anybody help me out?

                      Regards,
                      Frank
                      • 8. Re: Problem with DYNAMIC ACTION CONFIRM maybe a bug
                        FrankBohlken
                        Hi To all,

                        Still no solution for my problem.
                        disadvantage of my solution is that confirm is after submit. Best option is still to use a dynamic action or ajax functionality.
                        I changed my example so it is more clear wat my problem is.

                        I splitted the functionality first action i check a function and return the result into a page item.
                        Second I check the value of this page item depending on the value i want to see a confirm message.

                        I also test i the function uses the right input parameters thats the case (changed temporarily the function returned the input parametesr into a page item)

                        See my example on http://apex.oracle.com
                        Workspace = fbo_demo
                        user = demo
                        pp= demo

                        In Page 8 = Transactions problem dynamic actions da_confirm

                        In page 7 = Article you can see article are in possession by which customer

                        Example:
                        Want to see direct a confirm when you choose customer Dulles and choose article Bag
                        Because the bag is in possession of Hartfield
                        After first submit there is no confirm message.
                        When second time also choose for Dulles and a bag then briefly there shows up a confirm message that will almost immediately disappears.
                        By the way this is different behavior as in my own application there the confirm messages doesn’t disappear.


                        Hopefully somebody can help me out.

                        Greetings Frank
                        • 9. Problem with DYNAMIC ACTION CONFIRM maybe a bug
                          FrankBohlken
                          Hi There,

                          I solved a part of my problem.
                          The confirm shows up at the right moment.
                          The problem now is that when the confirm shows up the process doesn't stop.
                          I like that the process stop till user has given an answer on the confirm.
                          Anyone now here an answer on?

                          Greetings,
                          Frank