This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Nov 17, 2012, 1:23 PM
12 Posts
topic has been resolvedResolved

ssjs timer - auto save

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer,Administrator
  • Tags: save
  • Replies: 4
 Hi Developer,
 
I am searching for a solution to save a document on a xpage after XXX seconds, like a timer. 
 
I have already unsuccessful tested it with a CSJS Timer and triggered an onchange event in an editbox, but it doesnt affect anythink on the document.
 
Could anybody help me ?
 
Greetings,
Martin 
Nov 17, 2012, 2:05 PM
135 Posts
Re: ssjs timer - auto save
 How about CSJS timer which clicks Save-button with button.click()? Or you could make a more sophisticated solution with dojo.xhrPost.
 
- Panu 
Nov 17, 2012, 2:11 PM
12 Posts
Re: ssjs timer - auto save
Cool, but i should restrict my problem a little bit. 
 
When the timer is over, the DocSave should be in background without an partial refresh. 
 
The Button.onclick() event was also unsuccessful.
In my case i triggered the onclick event from CSJS function (I used dojo), but the SSJS Code from the Button onclick event was not applied ( simple console print).
 
The other solution dojo.xhrPost()  sounds pretty good, but could I execute SSJS within it ?
 
Greetings from Berlin 
Martin 
Nov 17, 2012, 5:56 PM
135 Posts
Re: ssjs timer - auto save
Button.click() executes SSJS for me. 
 
With xhrPost you could post data to the server but might end up with save conflict after the user saves, haven't tried that.
 
Btw. did you google? I tried "Xpage autosave" and this is the 3rd hit:
 
http://stackoverflow.com/questions/12971605/autosave-function-in-ajax-mode 
 
 
Nov 19, 2012, 10:24 AM
12 Posts
Re: ssjs timer - auto save
 Thanks a lot !
 
works perfect ;) 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal