Update data showed in xBrowse
Update data showed in xBrowse
Hi guys,
I have a xBrowse where I show rows of a MySql Table. This module is opened in several computers at the same time and records are being modified.
What is the best way to keep updated the rows that are being shown in this xBrowse?
I have a xBrowse where I show rows of a MySql Table. This module is opened in several computers at the same time and records are being modified.
What is the best way to keep updated the rows that are being shown in this xBrowse?
Re: Update data showed in xBrowse
Code: Select all | Expand
oBrw:Refresh(.T.) ??
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Update data showed in xBrowse
Karinha,
No my friend, oBrw:Refresh(.t) doesn't help.
The records are being modified in other computers, so i wanted to know if there is a way to be notified when the records need to be updated in xbrowse, because they were modified in others computers.
No my friend, oBrw:Refresh(.t) doesn't help.
The records are being modified in other computers, so i wanted to know if there is a way to be notified when the records need to be updated in xbrowse, because they were modified in others computers.
Re: Update data showed in xBrowse
I use a refresh button with oBrw:oRs:Requery()
Maurizio
Maurizio
Re: Update data showed in xBrowse
Than you Maurizio,
Nowaday, I'm doing like you.
Nowaday, I'm doing like you.
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Update data showed in xBrowse
You could refresh the browse by using a timer (to read current data of changed items and if so refresh) so that changes on other computers will change the data on all computers.
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
Re: Update data showed in xBrowse
Thank you Marc,
Yes, we're using a timer too. But I think xbrowser could have a method to Sync automatically all records that are been shown.
Look, not all the oRowset's records, just those that are visible right now in the xbrowser
Yes, we're using a timer too. But I think xbrowser could have a method to Sync automatically all records that are been shown.
Look, not all the oRowset's records, just those that are visible right now in the xbrowser
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Update data showed in xBrowse
Maybe a autosync can be build .... I think from a earlier post from Mr. Rao that Xbrowse only updates the visible rows and not need to read the full rowset.
In that post we where talking about uptimised filters and indexes and Mr. Rao wanted to explain that in full theorie/praktic but due to time/work that item was not covered yet.
You probebli know that speed issues over LAN are gone once using FWH with Remote Desktop.
In that post we where talking about uptimised filters and indexes and Mr. Rao wanted to explain that in full theorie/praktic but due to time/work that item was not covered yet.
You probebli know that speed issues over LAN are gone once using FWH with Remote Desktop.
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
Re: Update data showed in xBrowse
Yes, Something like an autosync would be great!
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Update data showed in xBrowse
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
Re: Update data showed in xBrowse
Yes,
But, there he is doing autosyng in the same computer and I need it in different computers.
But, there he is doing autosyng in the same computer and I need it in different computers.
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Update data showed in xBrowse
Obviously oBrw:Refresh() can not make oRs to read the records from the Server again.No my friend, oBrw:Refresh(.t) doesn't help.
Requerying frequently makes the application sluggish.
There is a less known method
Code: Select all | Expand
oRowSet:Refresh()
But this works only if the table contains a column that records "modified datetime"
Though it is very easy to create that kind of column using our library, I am sure most of users might not have created such column.
Code: Select all | Expand
oRowSet:Resync() // --? lChanged
Returns if the record is changed by other users.
Code: Select all | Expand
oRowSet:NetChanged( [RecNo], [@lDeleted] ) // -->lChanged
Code: Select all | Expand
oBrw:bChange := { || If( oRs:NetChanged(), oBrw:RefreshCurrent(), nil ) }
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Update data showed in xBrowse
Thank you Mr Rao, your advices are always great!
Do you think is possible to do an option to verify all visible record in the xBrowse and update only those that were changed?
Nowaday, I'm doing it by this way:
But i believe it could be done better
Here, oRowSet:Resync() is always returning .T., even the record was not changed.oRowSet:Resync() // --? lChanged
Do you think is possible to do an option to verify all visible record in the xBrowse and update only those that were changed?
Nowaday, I'm doing it by this way:
Code: Select all | Expand
LOCAL lTem:=.F.,nPos:=0,nRegAt := ::oTab:Recno()
DEFAULT bBloco := {|| .T.}
::oTmr:DeActivate()
::oTab:Skip(::oLbx:nRowSel * (-1))
DO WHILE nPos < ::oLbx:nDataRows .AND. .NOT. ::oTab:Eof()
IF Eval(bBloco)
lTem := .T.
::oTab:ReSync()
ENDIF
nPos++
::oTab:Skip()
ENDDO ::oTab:GoTo(nRegAt)
IF lTem
::oLbx:Refresh()
ENDIF
::oTmr:Activate()
Last edited by vilian on Thu Sep 12, 2024 4:46 pm, edited 1 time in total.
Re: Update data showed in xBrowse
I'm using Eval(bBloco) because I have some status where a record can't be modified anymore, so if he is in this status, i don´t need resync it.