Updating the page

  • kambilot
    Participant
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Basics (100)
    1 month ago #69339

    Hello,

    I have a new challenge and wanted to ask if you have had a similar case: on one of our portals, customers can select certain items and initiate a payment process. After successful payment, the customer sees an information page confirming that the transaction was successful, and on this page there is a button labelled ‘Back to overview’. When a customer clicks on the button, Simplifier takes about 1-2 seconds to update the item order page to show the overview of items, where no items can be selected for ordering. If a customer is quick enough, they can order the same items a second time. What would be the best solution to prevent this from happening?

    Thank you in advance.

    Kind regards,
    Leonid Gauss

    • This topic was modified 1 month ago by kambilot.
    • This topic was modified 1 month ago by kambilot.
    Armin Winkler
    Moderator
      Has successfully completed the online course Introduction
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
    2 weeks, 2 days ago #70123
    Up
    0
    Down
    ::

    Hi Leonid,

    this is indeed a common problem and your best solution would be to block the submit button as soon as the click happened and wait for a defined time interval until it may become clickable again. We are intending to make respective enhancements for some of our Simplifier widgets like ‘Button’ in a future version of the Standard Content package, but currently you would need to add this behaviour on your own still.

    I find the easiest way to only allow one click on a button during a given time interval is by using a throttling mechanism. The Javascript library lodash, which is included in our Standard Content, offers such functionality. The throttle method of lodash expects a callback function that should only get invoked once per the given time interval in milliseconds. You could write a small function inside a Script activity or inside a client-side business object which invokes a custom event via the API ‘this.callCustomEvent(‘<myEventName>’)’ inside its body. This Script / client-side business object activity needs to be connected to the press event of your button. As an effect, the custom event would only get invoked once during that time interval, so you could decide to allow only one click on the submit button per every x seconds.

    If you would require a standard function for throttling events in our Standard Content, you could also express this wish by creating a feature request in our Ideasportal.

    Please let us know whether this helps you.

    Kind regards,

    Armin

    Leonid Gauss
    Participant
      1 week, 6 days ago #70125
      Up
      0
      Down
      ::

      Hello Armin,

      Thank you for your reply. In the meantime, I had the idea of redesigning the customer portal so that no page refresh would be necessary, but the problem still persists after the redesign, so I was mistaken and will have to use the method you described.

      Best regards, Leonid

      Leonid Gauss
      Participant
        1 week, 3 days ago #70397
        Up
        0
        Down
        ::

        Hello Armin,

        delaying the response time of the button does not help – I have tried it, it still executes regardless of how long the delay is. The actual problem here is this: this button, which leads to the payment process, is disabled by default and is only activated when an item is selected in the table. If you jump back to the table with the items after the payment process, the button is activated  (the item is also ticked ) and you can click on it! But it has to be disabled. Is this controlled by browser cookies?

        Kind regards

        Leonid

        • This reply was modified 1 week, 3 days ago by Leonid Gauss.
      Viewing 4 posts - 1 through 4 (of 4 total)

      You must be logged in to reply to this topic.