disable reset in toolbar

Posted by pauldownie on 14-May-2013 09:09

Hi,

I have a screen where a user can drop a file on a window to trigger an add record transaction. I want to disable the reset button during that transaction to avoid any ambiguity about whether the file will still be referenced after the reset. I am finding that while I can disable "cancel" and "save" using disableActions, I can't disable "reset". I have also tried modifyDisabledActions and am coming up with the same problem. Does anyone have any idea about what is going on and how to get this to work?

thanks,

Paul

10.2b, Windows XP

All Replies

Posted by Håvard Danielsen on 14-May-2013 14:53

Try to disable "UndoChange" instead. This action was added to the toolbar due to limitations with the "Reset" action. I do not remember any details, but it was basically impossible to make the "Reset" action support all tableio modes and states without breaking backwards compatibility. Of course, removing it would also break backwards compatibility, so "Reset" and "UndoChange" are both available in the toolbar, but the "Reset" defaults to hidden. (If you open the Instance Property Dialog and select the Tableio Category, you should see both actions and that the hidden check-box is checked on "Reset". You are not allowed to change these directly, but the two actions are swapped when you check/uncheck the Undo changes check-box.)

I am finding that while I can disable "cancel" and "save" using disableActions, I can't disable "reset". I have also tried modifyDisabledActions and am coming up with the same problem. 

You should use modifyDisabledActions and not disableActions() to disable actions from code. The disableActions() and enableActions() functions do set the state as requested, but the setting will only last until the next toolbar refresh/state change. The modifyDisableActions, on the other hand, adds or removes actions to/from the DisabledActions property, which is always honored when the toolbar state is changed.

Posted by pauldownie on 14-May-2013 16:00

Thanks Havard. That's it.

This thread is closed