Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: BBrowser 4 Autorefresh of recordgroup with recalculate Date: Fri, 7 Feb 2020 07:31:33 +0100 Lines: 100 Message-ID: References: <9a6d81f7-43ef-454b-99b1-705c09c3141e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: individual.net hb1Z7PKL1gvFnDojoslKmgqoFTPrRhu4PdyUDgH4PeRti/MdM= Cancel-Lock: sha1:nD7jZGpMraeULmIjMkNGqPTkXbE= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:12826 Hi Jean-Philippe, do you have tried to send a Notify( NOTIFYFILECHANGED )? Then the bBrowser should reload completely. Wolfgang jeanphilippe@igsoft.be wrote: > Dear everyone, > > I want to show data with auto refresh every 10 seconds using bbrowser > 4 and recordsgroups. > > I call a timer every 10 seconds to refresh data with this code : > > self:oDCbBrowser1:Recalculate() > self:oDCbBrowser1:Refresh() > self:oDCbBrowser1:Redraw() > > > But when a record change of group, a new group is created rather than > joining the existing one : > > https://drive.google.com/file/d/1_cQmV9QC0T_JpzwjQme5Pnhr1frKn0V9/view > ?usp=sharing > > > My code for the group > > Method EnableGroups() class W_ATELIER_STATUS > > LOCAL oRecordGroupLevel as bRecordGroupLevel > LOCAL cGroupKey as STRING > LOCAL ocbGroupHeader as bCodeblock > LOCAL oGroupHeader as bRecordGroupHeader > LOCAL oFont as Font > LOCAL oGrid as bGrid > LOCAL cExpression as STRING > > // Initialize record groups > self:oDCbBrowser1:RecordGroup:LevelList:Clear() > self:oDCbBrowser1:gotop() > > // Record Group: Initializing Level 1 > > > cGroupKey := "Str(NumSoc, > "+tostring(oEnvObject:nSocSize)+")+Str(ETAT,2)+LASTJOB" cExpression > := "IIF(!Empty(LASTJOB), LASTJOB, '"+trad(self,"Aucun")+"')" > > oRecordGroupLevel := bRecordGroupLevel{bCodeblock{cGroupKey, > self:oDCbBrowser1:server},; ,; > nil,; > _or(BRGLO_AUTOOPEN, > BRGLO_GROUPLEASH, BRGLO_SERVERSEEK)} > oRecordGroupLevel:GroupRowHeight := 24 > ocbGroupHeader := bCodeblock{cExpression,; > self:oDCbBrowser1:server} > > oGroupHeader := bRecordGroupHeader{ocbGroupHeader} > oRecordGroupLevel:GroupHeader := oGroupHeader > > oGrid := bGrid{BGRID_OUTLINEHORIZONTAL, , , , , Color{COLORBLACK}} > oFont := self:oDCbBrowser1:GetDefaultFont() > oFont:Bold := true > oRecordGroupLevel:GroupView := bViewStyle{ ,; > ,; > BALIGN_LEFT + > BALIGN_BOTTOM,; oFont,; > oGrid} > > > > > > self:oDCbBrowser1:RecordGroup:LevelList:Add(oRecordGroupLevel) > > // Record Group: Recalculate the bBrowser and refresh the data > // so that the record group levels are regard > self:oDCbBrowser1:Recalculate() > self:oDCbBrowser1:Refresh() > self:oDCbBrowser1:Redraw() > > return nil > > > I have the same sort of behavior using > > self:odcbBrowser1:AutoRefreshTime := 5000 > > Any way to make it works ? > > Best regards, > Jean-Philippe Bayard --