HI,
I have configured a view in perspective in which I have used Multistate button to show status and applied authentication to this object using Configure Event-> Security Settings->Script->OnClick Action. However, when the IMultistate button object is clicked with unauthorized login it gives warning "Action Denied" but click event executes and button changes its state.
I am unable to find out the issue with this configuration.
onClick will always occur whether a user has permissions or not because the click event is not something you can prevent. if you only want an action to be performed when a button is enabled, per se, or a user has the required permissions, then you should use onActionPerformed.
This is a good point. I just noted that the Inductive University video for “Dock Action” shows using the Mouse Click event for this instead of onActionPerformed. (at about 2:58) This led me to search for this in the forum.
If I recall correctly, it seems the videos often show Mouse Click used on buttons instead of action performed. Obviously this means that if a user utilizes tab stops and keyboard actions to fire the button, the button will not perform expected function. It might be prudent to show best practice for button usage in the videos.
That’s true, and something that will probably be revisited once those videos are remade, but in fairness to the training department, I’m pretty sure buttons didn’t have an onActionPerformed method when those videos were made.
The Security Settings described earlier in this thread pertain ONLY to the Script they are attached to. These Security Settings do NOT prevent users from clicking the button - and therefore modifying the associated controlValue. If you need to prevent a user from interacting with the Multi-State Button you need to bind MultiStateButton.props.enabled against some sort of permission requirement.