How to maintain the page state in Domino Web Application

279 views Asked by At

I am working on a Web Application developed & hosted on Domino R9 Server (Non Xpages Web Application). Each form has WebQueryOpen and WebQuerySave events implemented for the server side business logic. Problem is that on every page, when the page refreshes from the browser, application's home page/form is loaded. I want to maintain the state of a page in this application. Moreover, is there any possibility of implementing an Ajax based session handling (backend) in case the page was idle for sometime and session expired. For example if a user was writing something in the Web Editor (implemented in CKEditor latest version) and if his session is automatically dropped he should be able to start with least hassle and his already written stuff may not be lost.

2

There are 2 answers

3
Karl-Henry Martinsson On

My suggestion is to not use WebQueryOpen and WebQuerySave. Instead write the application to use modern web technologies (Ajax, JSON, REST API), then you don't need to save and reopen the page all the time. Doing that will give you everything you want.

I would build the page using standard HTML and Javascript (or even jQuery), then make Ajax calls to agents on the server to read/write data.

I have given several presentations on exactly this, with plenty of code samples and even finished code to download:
http://blog.texasswede.com/mwlug-2015/
http://blog.texasswede.com/my-mwlug-presentation-2/
http://blog.texasswede.com/my-connect-2017-demo-code/

2
Justo Antonio Garrido Herrador On

You can save the contents from all fields and CKEditor in a JSON string and also the UNID (or any "primary key") to the current entity (=page).

Afterwards, you can send this string to the server using AJAX, or as an alternative...

... have you tried using HTML5 local storage? See this page: https://www.w3schools.com/html/html5_webstorage.asp Tell us how do you continue!!!