nageswaragunupudi wrote:But mostly, I suggest leaving it to XBrowse, whether to Refresh() or RefreshCurrent()
XBrowse knows it better.
Let us not interfere.
Now I wonder ..... I think I do some refresh to much then ?
Are these refresh OK ?
:bChange := { || nSecs := SECONDS(), Scope("factinfo","document","factart","factart"),oBrw[6]:refresh() }
:bChange := { || scopetimer(oBrw),('foto')->(DBGOTOP()),oBrw2:Refresh(),oBrw4:gotop(),oBrw4:Refresh(),oImage:Refresh(),oImage2:Refresh(),Obrw:refresh(),Oget:refresh(),oGet2:refresh() }
oFld:bAction := { || (FolderActions("KLANTEN",oFld),oBrw[1]:gotop(),oBrw[1]:refresh()) }
DEFINE BUTTON OF oBar PROMPT "Edit" RESOURCE "edit" ;
ACTION (oBrw:EditSource(),oBrw:refresh(),oBrw:setfocus() )
DEFINE BUTTON OF oBar PROMPT "Filters Uit" RESOURCE "EDIT";
ACTION (oBrw:lGetBar:= .F.,oBrw:refresh(),oBrw:setfocus() )
@ 05,200 BTNBMP oBtn PROMPT "Delete" RESOURCE "DEL" SIZE 60,60 PIXEL OF oBrw NOBORDER ;
ACTION ( (oBrw:cAlias)->(Brwdelselect(oBrw)),oBrw:refresh() ) TOOLTIP "Delete geselecteerde records"
I also do this and I think it is also not the best way ...
Insite browse I manipulate data with the schift/select and then process
- Code: Select all Expand view RUN
case cData = "WEBSHOP_GROEPEN" .and. cButton = "2_2" // lookup data in second dbf and change it in xbrowse (dbf)
if msgyesno("De SHIFT-geselecteerde vervangen met de originele superteksten")
netopen("nofoto","BRANDID","nofotoTemp")
if webshop->(flock())
FOR I = 1 TO LEN(oBRWT2:aSELECTED) // obrw:aSELECTED is an array containing recnos marked
webshop->(dbgoto(oBRWT2:aSELECTED[I]))
cZoek = webshop->brandid
if nofototemp->(dbseek(cZoek))
if !empty(nofototemp->memotxt)
webshop->memotxt = nofototemp->memotxt
web_changes("MEMOTXT")
endif
endif
next
webshop->(dbunlock())
endif
close nofototemp
endif
case cData = "NOFOTO" .and. cButton = "NOFOTO_1_2"
if msgyesno("Markeren als NIET geselecteerd")
if nofoto->(flock())
FOR I = 1 TO LEN(oBRWT2:aSELECTED) // obrw:aSELECTED is an array containing recnos marked
nofoto->(dbgoto(oBRWT2:aSELECTED[I]))
replace nofoto->selected with .F.
next
nofoto->(dbunlock())
endif
endif
// this is a better version of Xbrowse use I think. Changes are in Xbrowse itself like You advice ?
case cData = "ARTIKEL" .and. cButton = "3_1"
// This will change all selected data from that column with a value given in cZoek
Xbrowser oBrwT2:cHeaders TITLE "Select het te wijzigen veld" SETUP (oBrw:cHeaders := {"Veldnaam"}) SELECT nVeldID:= oBrw:Veldnaam:Value
EDITVARS cZoek PROMPTS "Geef de waarde die we zullen gebruiken (NUL = 0) "
do case
case empty(cZoek)
RETURN
case cZoek = "NUL" // I need a really ZERO value here
mem_var = 0
case oBrwT2:aCols[oBrwT2:nColSel]:cDataType == 'N'
mem_var = val(cZoek)
case oBrwT2:aCols[oBrwT2:nColSel]:cDataType == 'L'
mem_var = .t.
case oBrwT2:aCols[oBrwT2:nColSel]:cDataType == 'D'
mem_var = ctod(cZoek)
otherwise
mem_var = cZoek
endcase
if msgYesNo("Wijzigen doorvoeren")
FOR I = 1 TO LEN(oBRWT2:aSELECTED) // obrw:aSELECTED is an array containing recnos marked
(oBrwT2:cAlias)->(dbgoto(oBRWT2:aSELECTED[I]))
oBrwT2:&nVeldID:Varput( mem_var )
NEXT
endif