FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Update xBrowse automatically
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Update xBrowse automatically
Posted: Wed Oct 20, 2021 01:33 PM

Dear Mr. Rao,

How can we automatically update an xBROWSE if someone in the network has changed a data record?

Best regards,
Otto

Posts: 128
Joined: Tue Jan 03, 2006 08:31 PM
Re: Update xBrowse automatically
Posted: Wed Oct 20, 2021 04:28 PM
Otto
maybe this way using a timer
Code (fw): Select all Collapse
//------------------------------------------------------------------------------
METHOD TimerDetail( oSender ) CLASS TFormVentas
  LOCAL nTotRecno

  nTotRecno:= oMySQLDS:Query("SELECT count(*) AS nTotRecno FROM ventas_historico")
  IF nTotRecno!= ::oSQLVentas:RecCount()
     ::oSQLVentas:Refresh()
  ENDIF
  ::oTimerDetalStop()
RETURN Nil

Regards!
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Update xBrowse automatically
Posted: Thu Oct 21, 2021 06:59 AM
Otto wrote:Dear Mr. Rao,

How can we automatically update an xBROWSE if someone in the network has changed a data record?

Best regards,
Otto


I assume you are referring to DBF tables. DBF RDD is the fastest database system and modifications to data are immediately known to all exes. Only we need to call Refresh().

Method-1:
Simple and well known way is the refresh with a timer. You wont even see a flicker. But, changes are not seen till next timer interval.

Method-2:
Push notification: Post message to all xbrowse windows whenever the DBF is modified.
Programming is a little involoved but can be done.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Update xBrowse automatically
Posted: Thu Oct 21, 2021 09:06 AM

I wonder if a timer running on the background will slow down the general performance of the computer ?

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Update xBrowse automatically
Posted: Thu Oct 21, 2021 10:50 AM

Dear Mr. Rao,
Thank you so much.
Do I create the timer in the function where xBrowse is local and destroy it after closing the function?
Would 1 sec. be ok?
Best regards,
Otto

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Update xBrowse automatically
Posted: Sat Oct 23, 2021 08:07 PM

Otto,

It is going to be continuously updating if it takes more than one second to redisplay the entire browse (especially if you are doing this over the internet).

Consider instead, just adding a Refresh button.

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Update xBrowse automatically
Posted: Sun Oct 24, 2021 05:34 AM
Dear James,

In reality, I do not need it for a network application in the classic sense.

Our customers all work via RDP on their servers.
WINHOTEL is, so to speak, similar to a single-user solution.

Now I want to use FIVEWIN and mod harbour in parallel.

See attached GIF.

When I briefly change the focus, for example from the browser window to the menu bar, the data is updated immediately.

Best regards,
Otto

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Update xBrowse automatically
Posted: Sun Oct 24, 2021 05:47 AM
Here is my function how I start Chrome from FIVEWIN.

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Update xBrowse automatically
Posted: Sun Oct 24, 2021 06:02 AM
Here you see the mod harbour code for showing Googlemaps.
If there is interest, I can continue to show more of the mod harbour code.



http://forums.fivetechsupport.com/viewtopic.php?f=45&t=40946&sid=c6d5840853f3697a1e3c95f89562e5ae

Continue the discussion