Auto save
(Automatically adding template at the end of the page.)
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:


== Auto Save of 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 removing the need for a "save button". This behaviour might be removed by creating a periodic action that will save the page if it contains dirty data.
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".  


Peridic action (repeat every i.e 2000 ms, visible if there is dirty data  :
The easiest way to accomplish this is to use the ViewModel tagged value, [[Span.Eco.AutoSave]]


<pre><code>
You can also do this "manually" if you have special needs, like this:
if vCurrent_ViewModel.IsDirty  then
 
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>
if selfVM.IsDirty  then
selfVM.Save;
selfVM.Save;
   0
   0
Line 12: Line 16:
   0
   0
endif
endif
</code></pre>
</pre>


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

Revision as of 15:27, 10 February 2024

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 easiest 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 Layout_and_CSS.

This page was edited 6 days ago on 05/05/2024. What links here