Skip to main content

we are using action frame work on the button click where are displaying block UI Message " Please wait" . before the screen comes up we are able to click the button multiple times.is there any solution that we have to disable the button once clicked

  1. Give your Button a Unique Id, e.g. “MyButton”.
    2. Add an Action in your sequence that occurs immediately when you Block UI called “Run Skuid JavaScript Snippet” that runs a JavaScript Snippet, call the snippet something like “DisableMyButton”. The content of the Snippet should be this:

    skuid.$(“#MyButton”).button(“disable”);

    3. Later on in the sequence, when the button should be enabled again, add another Run Skuid JavaScript Snippet action to the sequence, that calls a Snippet “EnableMyButton”, whose content should be this:

    skuid.$(“#MyButton”).button(“enable”);


Is there any change to this approach? It’d be nice to do this declaratively instead of through JS.


Korey,

There are at least a few declarative ways to do this, most importantly you’ll need to use the “Enable Conditions” property under the Rendering tab for the button’s properties.

Then you simply need to decide what criteria you want to use to enable that button. Likely using one of the actions in the button’s action sequence could serve as the criteria. For example, if your button updates a field on a record, then you could use that field’s value as the enabling condition.

You could also create a UI-only checkbox field (set default value to TRUE) and include an action to uncheck that box off within your button’s action sequence. Then your enabling condition would be when that checkbox value is equal to true.

In other words, your button is enabled until you click it, the action unchecks the UI-only checkbox, and your button becomes disabled.




Thanks Conlan, I ended up going the UI-checkbox route. It would still be nice to be able to explicitly disable a button rather than adding multiple steps to check if it stays enabled.


Yeah, that would be nice.

As a feature request, maybe the Skuid product team would be willing to add an option to ‘Enable/Disable Button’ under the Run Component Action… 🙂