Auto save
No edit summary
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>


== Auto Save of the Page (No Save Button Needed) ==
=== Auto Save of the Page (No Save Button Needed) ===
Sometimes, one might want to provide the user with a user interaction model where the content on the page is saved automatically and thus, remove the need for a "save button".  
The default for a MDriven application is to provide users with a Save button. By doing so the user get the ability also to undo and redo changes, giving a full desktop experience.  


The easiest way to acclompish this is to use the viewmodel tagged value [[Span.Eco.AutoSave]]
But when you develop for mobile phones, you might want to provide the user with a user interaction model where the content on the page is saved automatically and thus, remove the need for a "save button".  


You can also do this "manually" if you have special needs, like this;
The easiest ('''and recommended''') way to accomplish this is to use the ViewModel tagged value, [[Span.Eco.AutoSave]]


Periodic action (repeat every i.e 2000 ms and set DisableExpression to 'not selfVM.IsDirty' in order to only run when something IS dirty) is set to be visible if there is dirty data:
You can also do this "manually" if you have special needs, like this:
 
Periodic action (repeat every i.e. 2000 ms and set DisableExpression to 'not selfVM.IsDirty' in order to only run when something IS dirty) is set to be visible if there is dirty data:


<pre>
<pre>
Line 18: Line 21:
</pre>
</pre>


To hide the sidebar to not show the save button, please see [[Layout_and_CSS]].
To hide the sidebar to not show the save button, please see [[Documentation:Span.HideSidebar|Span.HideSidebar]]
 
[[Category:View Model]]
[[Category:View Model]]
[[Category:Tagged Values]]
{{Edited|July|12|2024}}

Latest revision as of 05:34, 19 June 2024


Auto Save of the Page (No Save Button Needed)

The default for a MDriven application is to provide users with a Save button. By doing so the user get the ability also to undo and redo changes, giving a full desktop experience.

But when you develop for mobile phones, you might want to provide the user with a user interaction model where the content on the page is saved automatically and thus, remove the need for a "save button".

The easiest (and recommended) way to accomplish this is to use the ViewModel tagged value, Span.Eco.AutoSave

You can also do this "manually" if you have special needs, like this:

Periodic action (repeat every i.e. 2000 ms and set DisableExpression to 'not selfVM.IsDirty' in order to only run when something IS dirty) is set to be visible if there is dirty data:

if selfVM.IsDirty  then
selfVM.Save;
  0
else
  0
endif

To hide the sidebar to not show the save button, please see Span.HideSidebar

This page was edited 15 days ago on 06/19/2024. What links here