Per viewmodel ReadOnly mode

Some systems want to make use of the distinction between opening a page for viewing - and intending to edit the data within.

There may be many reasons for this, but the one at the top of mind during our design, is that we have inexperienced users that are afraid to touch or update things they do not intend to update. These users can be made to feel safer if there is a switch on the page they need to flip in order to edit anything.

Of course, users still want to search and navigate the system - so the readonly logic should function much like an AccessGroup ViewEnable expression - that only locks down actions and controls that actually change persistent data.

Resources and abilities available now for a framework-backed per page readonly model:

  1. vSysReadOnlyMode:Boolean : a Special ViewModel variable will be detected and applied
    • When seen it will be "or"ed into the ViewModel.ExternalReadOnlyExpression - sharing this expression with any AccessGroups.ViewEnableExpressions.
  2. WillEffectPersistedDataOverrideValue : a tagged value to be applied to columns, actions and reverse-derived attributes to be used when you want to exempt from the automatic expression deduction if it changes persistent data or not.
  3. vSysReadOnlyMode is set to true on open of View
  4. vSysReadOnlyMode : is set reset from false to true after save and after cancel
  5. A special button placed along Save/Cancel called Lock/Unlock that toggles vSysReadOnlyMode
    • The default text in Turnkey will be "Write" as in "enter write mode" - to influence/translate the text create a global action of with Framework action: ExecuteFrameworkRuntimeActionRT.ReadOnlyModeToogle
  6. A way to set global readonly mode for the whole application:
    • Once the global readonly is in effect, you can skip for certain ViewModels by setting taggedvalue SysReadOnlyModeSkip=true on ViewModel
    • To turn on global readonly set SysMDrivenMiscSettingsSingleton.GlobalReadOnlyMode = true
Documentation Per viewmodel ReadOnly mode 1727250833571.png
This page was edited 57 days ago on 09/25/2024. What links here