Forcing user session to extend

18 views
Skip to first unread message

dros...@gmail.com

unread,
Apr 27, 2024, 12:40:24 PM4/27/24
to Lightning - 4D Web Applications
In v4...
I have a detail form that has an included enterable list form. It is used to conduct interviews. The included list has a series of questions and each row has a field for entering the answer. An interview can last more than 30 minutes. The timeout setting for the application is 30 minutes, and, for reasons not related to this interview interface, I don't want to increase the timeout minutes.

When a user enters a value in a field in the included list, I want Lightning to be aware of it so that the user's session will be recognized as active. I have tried adding an onchange property to the <ltg-obj> tag for one of the enterable fields, like this:

onchange="ltgExecuteMethod('Ltg_ExtendSession');"

The Ltg_ExtendSession method has no code in it except for the required $1 and $0 parameters, and the Shared by Components and Host Database property of the method is checked. When a user tabs out of the field, the method doesn't execute. I've also tried adding a method property instead of onchange:

method="Ltg_ExtendSession"

Same result. One other thing I tried: I added a "Save and Stay" button at the top of the included form, which simply calls the Ltg_ExtendSession method. That has the unintended effect of refreshing the list and reducing the displayed records to zero. 

Anyone have any ideas for keeping the session alive while the user is entering data in the included form, other than asking him/her to save the parent record frequently?

Thx,
David

dros...@gmail.com

unread,
Apr 27, 2024, 1:21:43 PM4/27/24
to Lightning - 4D Web Applications
The extending of the session is not the problem. The problem is that when a user is in a detail form and a database transaction has been started, and the user session times out, the transaction isn't validated and all of the entered data is lost.

Graham Langley

unread,
Apr 30, 2024, 5:21:43 AM4/30/24
to Lightning - 4D Web Applications
David,

In this scenario it may be better to use web tables, tables in your structure that will only be committed when the user clicks save, then you populate the main tables, and avoid using a transaction, they don't really work with web apps.

Reply all
Reply to author
Forward
0 new messages