Automatic xbrowse refresh

Post Reply
User avatar
Adolfo
Posts: 815
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile
Contact:

Automatic xbrowse refresh

Post by Adolfo »

Hi fivewinners.

Any idea on how to automatically refresh a xbrowse after a few minutes of inactivity (no key stroke)

Any help will be appreciated

Thanks in advance

From Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Lenovo Legion Y520, 16GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1050
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: Automatic xbrowse refresh

Post by Jack »

Hi ,

You can look at TIMER

DEFINE TIMER oTmr INTERVAL 6000 ACTION (oLbx:Refresh()) OF oWnd
ACTIVATE TIMER oTmr
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: Automatic xbrowse refresh

Post by Jack »

You have also setidleactin({||UDF()})

TestIdle.prg
User avatar
armando.lagunas
Posts: 340
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile
Contact:

Re: Automatic xbrowse refresh

Post by armando.lagunas »

Adolfo:
yo lo hago en una window..
se actualiza cada 30 seg aprox.

la funcion Recargar_Datos( oBrw ), es donde realizo el proceso de carga del xbrowse...

Code: Select all

static nCargo := 0

...
....
....
   ACTIVATE WINDOW xWnd NORMAL ON INIT  ( xWnd:Center(),  GoTimer( xWnd, oBrw ) ) 

RETURN Nil

//-------------------------------------------------------------------------

STATIC FUNCTION GoTimer( xWnd, oBrw )
LOCAL oTmr
     DEFINE   TIMER oTmr OF xWnd INTERVAL 1 ACTION IIF( nCargo > 799, ( Recargar_Datos(  oBrw ), nCargo := 0 ), nCargo += 1 )
     ACTIVATE TIMER oTmr
RETURN Nil

//-------------------------------------------------------------------------

 
espero de que te sirva.

Saludos
User avatar
Adolfo
Posts: 815
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile
Contact:

Re: Automatic xbrowse refresh

Post by Adolfo »

Thanks to all ...

Jack
SetIdleAction() is only for 16 bits and can cause app freeze.

Armando.
I need to control the time after the last keystroke is done, not at a defined period of time
SP: Necesito controlar el tiempo despues de la ultima tecla presionada, no a un periodo de tiempo definido.

If the user is working in the xBrowse, I let him do his job because I have a routine to do it after he modiies or sees any data, but if he leaves his workplace, I'm want to refresh it after some minutes, so if he returns, he can see new or modified data.

That's the idea.

From Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Lenovo Legion Y520, 16GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1050
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: Automatic xbrowse refresh

Post by Jack »

Hi,
When i start the xbrowe, i get the time() in a static / global var

When i use the on change, ik get the time in a the same static / global var

In the timer i compre the actual time with the static/gloval var and if it is too long, i do a frefresh() .

Philippe
Post Reply