Per viewmodel ReadOnly mode
No edit summary
(Replacing message template with parser tag)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Some systems want to make use of distinction between ''opening a page for viewing'' - and ''intending to edit the data within''.
<message>Write the content here to display this box</message>
Some systems want to make use of the distinction between ''opening a page for viewing'' - and ''intending to edit the data within''.


The reasons for this may be many but one that was 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 you need to flip in order to edit anything.
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 AccessGroup ViewEnable expression - that only locks down actions and controls that actually change persistent data.
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:
Resources and abilities available now for a framework-backed per page readonly model:


# vSysReadOnlyMode:Boolean : a Special ViewModel variable will be detected and applied
# '''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.
#* When seen it will be "or"ed into the ViewModel.ExternalReadOnlyExpression - sharing this expression with any AccessGroups.ViewEnableExpressions.
# WillEffectPersistedDataOverrideValue : a tagged value to be applied to columns and actions that you want to exempt from the automatic expression deduction if it changes persistent data or not.
# '''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.
# vSysReadOnlyMode is set to true on open of View
# '''vSysReadOnlyMode''' is set to true on open of View
# : vSysReadOnlyMode is set reset from false to true after save and after cancel
# '''vSysReadOnlyMode''' : is set reset from false to true after save and after cancel
# A special button placed along Save/Cancel called Lock/Unlock that toggles vSysReadOnlyMode
# A special button placed along Save/Cancel called '''Lock/Unlock''' that toggles vSysReadOnlyMode
# A way to set global readonly mode for the whole application
#* 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
## Once the global readonly is in effect you can skip for certain ViewModels by setting taggedvalue SysReadOnlyModeSkip=true on ViewModel
# A way to set '''global readonly mode''' for the whole application:
## To turn on global readonly set SysMDrivenMiscSettingsSingleton.GlobalReadOnlyMode = true
#* 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 '''[[Documentation:SysMDrivenMiscSettingsSingleton|SysMDrivenMiscSettingsSingleton]].GlobalReadOnlyMode = true'''
{{Edited|July|12|2024}}
[[Category:View Model]]

Latest revision as of 07:54, 17 June 2024

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
This page was edited 9 days ago on 06/17/2024. What links here