DCBROWSE autorefresh
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
DCBROWSE autorefresh
Hi all,
i have a scoped DCBROWSE with autorefresh and a display of the amount of reccords (dc_keycount()) in the scope. Now i like to update the display of the amount of records, if the autorefresh take place (every 5 seconds). How can this be done, can someone give me a hint ?
i have a scoped DCBROWSE with autorefresh and a display of the amount of reccords (dc_keycount()) in the scope. Now i like to update the display of the amount of records, if the autorefresh take place (every 5 seconds). How can this be done, can someone give me a hint ?
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: DCBROWSE autorefresh
Use the REFRESHBLOCK subclause of AUTOREFRESH.
[AUTOREFRESH <nRefreshInterval> [REFRESHBLOCK <bRefresh>]
In bRefresh block you would put your code to update the display.
[AUTOREFRESH <nRefreshInterval> [REFRESHBLOCK <bRefresh>]
In bRefresh block you would put your code to update the display.
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: DCBROWSE autorefresh
Thanks Roger,
but when using this, i always get an error in the line 896:
but when using this, i always get an error in the line 896:
Code: Select all
IF Empty(::refreshWhenBlock) .OR. Eval(::refreshWhenBlock)
Code: Select all
oError:args :
-> VALTYPE: L VALUE: N
-> VALTYPE: U VALUE: NIL
oError:canDefault : N
oError:canRetry : N
oError:canSubstitute: J
oError:cargo : NIL
oError:description : Parameter hat falschen Typ
oError:filename :
oError:genCode : 2
oError:operation : <.F.>.or.<NIL>
oError:osCode : 0
oError:severity : 2
oError:subCode : 3
oError:subSystem : BASE
oError:thread : 1
oError:tries : 0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Aufgerufen von DC_XBPBROWSE:HANDLEEVENT(896)
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: DCBROWSE autorefresh
The docs say:Wolfgang Ciriack wrote:Thanks Roger,
but when using this, i always get an error in the line 896:Code: Select all
IF Empty(::refreshWhenBlock) .OR. Eval(::refreshWhenBlock)
Code: Select all
oError:args : -> VALTYPE: L VALUE: N -> VALTYPE: U VALUE: NIL oError:canDefault : N oError:canRetry : N oError:canSubstitute: J oError:cargo : NIL oError:description : Parameter hat falschen Typ oError:filename : oError:genCode : 2 oError:operation : <.F.>.or.<NIL> oError:osCode : 0 oError:severity : 2 oError:subCode : 3 oError:subSystem : BASE oError:thread : 1 oError:tries : 0 ------------------------------------------------------------------------------ CALLSTACK: ------------------------------------------------------------------------------ Aufgerufen von DC_XBPBROWSE:HANDLEEVENT(896)
AUTOREFRESH <nTimer> is used to set a timer event that automatically
refreshes the browse window (when it is visible) every
<nTimer>/100 seconds. REFRESHBLOCK <bRefresh> is an optional
code block to evaluate rather than using the default :refresh()
method. WHEN <bRefreshWhen> is an option codeblock to evaluate
to cause the refresh to occur only when the codeblock returns a
.TRUE. value.
It looks like the when codeblock is not returning a TRUE or FALSE value. Are you using the AUTOREFRESH...WHEN clause? If not try giving it a codeblock that always returns TRUE.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: DCBROWSE autorefresh
Try this:
Code: Select all
.. REFRESHBLOCK {||myRefreshFunction()} WHEN {||.t.}
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: DCBROWSE autorefresh
Hi Roger,
i have tried it with bWhenBlock and without, every time the same error. Here is my code:
i have tried it with bWhenBlock and without, every time the same error. Here is my code:
Code: Select all
@2.4,0.5 DCBROWSE oMainBrowse ;
DATA cAlias ;
SIZE min(br-20,iif(pInstMobile,116,114)), ho-5 ;
CURSORMODE XBPBRW_CURSOR_ROW ;
PRESENTATION aPresPar1 ;
ITEMSELECTED {|| iif(userrights>=RIGHTS_E, StartAufBearb(), NIL), oMainBrowse:refreshAll(), SetAppFocus(oMainBrowse) } ;
ITEMMARKED {|| bau->(dbseek(str(auf->baustelle,7),,1)), dc_getrefresh(GetList,,DCGETREFRESH_ID_INCLUDE,aRefId), oKfzBrowse:RefreshAll() } ;
ID "IDBRW" ;
FREEZELEFT iif(pInstMobile,{1,2,3,4,5,6,7},{1,2,3,4,5,6}) ;
TABSTOP ;
EVAL {|o| o:ItemRbDown:={|aMPos,aLC,oBr| dc_getrefresh(oPopupMenu), ActRbMenu(aMPos,aLC,oBr,oPopupMenu)} } ;
AUTOREFRESH refrwert REFRESHBLOCK {|| dc_getrefresh(oAnzRec) } WHEN {|| .T. }
* AUTOREFRESH refrwert WHEN {|| .T.SetAppFocus()=oMainBrowse } REFRESHBLOCK {|| dc_getrefresh(oAnzRec) }
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: DCBROWSE autorefresh
This this:
Code: Select all
REFRESHBLOCK {|| dc_getrefresh(oAnzRec), .t. }
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: DCBROWSE autorefresh
Hi Roger,
i read the docs and thougt, only the WHEN codeblock must return a logical value. Thanks for the clarification.
i read the docs and thougt, only the WHEN codeblock must return a logical value. Thanks for the clarification.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: DCBROWSE autorefresh
I will have to correct that in the docs.
The eXpress train is coming - and it has more cars.
Re: DCBROWSE autorefresh
Unless I am mistaken, shouldn't lines 336 and 337 in _dcxbrow.prg
be changed to
Code: Select all
::refreshWhenBlock := aArray[47]
::refreshBlock := aArray[48]
Code: Select all
::refreshWhenBlock := aArray[48]
::refreshBlock := aArray[47]