*system object

Started by ChrisKCAi, March 31, 2021, 06:23:37 PM

Previous topic - Next topic

ChrisKCAi

In regular PxPlus/Nomads, we use the system object to generate a timeout event and then use our function key handler to catch the generated CTL value & execute some logic.
Something like:
def object MY_SYSTEM_OBJ,"*system"
enable event on tim=MY_INTERVAL
on event "TimeOut" from MY_SYSTEM_OBJ preinput MY_TIMEOUT_CTL

It looks like that event doesn't get generated or gets swallowed up when running via iNomads/browser - is that correct? If so, is there something analogous we can use in iNomads?


Mike King

Is there a reason you didn't use the standard %Nomads'Timeout property to define a  page timeout then, on receiving the Timeout (CTL=-1900) either execute your Function key logic or do a PREINPUT to queue it up?

This would work on Both whereas setting a system timer on the server will result in an out of sync scenario between the host and browser.  That is the host will receive what it things is input from the browser and try to respond, however since the browser didn't send the event it will not be expecting the response from the host.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

ChrisKCAi

Maybe I'm operating on a misconception (wouldn't be the first time). I thought using the timeout event of the *system object meant "trigger the event (& CTL) every X seconds", regardless of how long it had been since user input had been received, whereas the setting the global 'Timeout meant "send a panel close (and CTL=-1900) after X seconds of idle time/no input".

ChrisKCAi

After poring through the iNomads doc, I think I can use the 'User_poll_routine$ property to pretty much replicate the behavior I want:

User_Poll_Routine$ If set by developer, system will call this routine every time a poll is received from the browser.