Disable Dynamic Link

HI All,

     I have implemented a Export to excel functionality, where clicking on Export to excel will kick off the process , and once the document is available the Download excel link will be made available,

     the problem is, the user can click on export to excel multiple times at a time, 

     is there a way , i can disable the export to excel link until the process is completed 

     Thanks in advance

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    I implement this using a local state going from "Not started" -> "Waiting" -> "Completed". Depending on state I display UI components (showWhen) which allow the user to "Start Export", "Refresh" or "Download".

  • 0
    Certified Lead Developer

    In 21.2, if you can move this functionality to a button instead of a link, you can utilize the new "loadingIndicator", parameter which will disable the button and show a little "loading" type icon while your process runs in the background (AFAIK the loading indicator will last until chaining breaks in the process, which should work well for generating the document and returning the generated doc ID back to your interface).

    In prior versions I usually have to rely on user training and/or intuition to not spam-click the generate link.  You could try doing an initial saveInto that disables the button/link right after the initial click, but I'm not sure it takes effect quickly enough to do what you're wanting.

  • 0
    Certified Senior Developer

    You could hide the Export to excel link once the user clicks it.

    I have included an example with a button widget.

    a!localVariables(
      local!showWhen: true,
      a!buttonWidget(
        label: "Button",
        style: "PRIMARY",
        showWhen: local!showWhen,
        saveInto: a!save(
          local!showWhen,
          false
        )
      )
    )