AutoRefresh when
AutoRefresh when
Roger,
using the latest release, the when clause of autorefresh seems to turn off autorefresh completely.
This browse works w/ autorefresh and no when clause. After added when clause (which always returns .t.), auto refresh stops working.
What am i screwing up now, oh wise one ??
@ .7,1 DCBROWSE olotBrowse ;
ALIAS 'LOT' ;
SIZE (nStaticWidth-4),(nBottom-.5) ;
PRESENTATION DC_BrowPres() ;
PARENT olotStatic ;
ID "OLOTBROWSE" ;
FONT cSayFont ;
HEADLINES 1 ;
AUTOREFRESH m->nBrowseRefresh WHEN {||myautorefresh()} ;
RBSELECT ;
RBDOWN BrowseMenuBlock(@oLotBrowse) ;
COLOR bColor ;
RESIZE DCGUI_RESIZE_RESIZEONLY ;
ITEMSELECTED {||EditCell(oLotBrowse) }
using the latest release, the when clause of autorefresh seems to turn off autorefresh completely.
This browse works w/ autorefresh and no when clause. After added when clause (which always returns .t.), auto refresh stops working.
What am i screwing up now, oh wise one ??
@ .7,1 DCBROWSE olotBrowse ;
ALIAS 'LOT' ;
SIZE (nStaticWidth-4),(nBottom-.5) ;
PRESENTATION DC_BrowPres() ;
PARENT olotStatic ;
ID "OLOTBROWSE" ;
FONT cSayFont ;
HEADLINES 1 ;
AUTOREFRESH m->nBrowseRefresh WHEN {||myautorefresh()} ;
RBSELECT ;
RBDOWN BrowseMenuBlock(@oLotBrowse) ;
COLOR bColor ;
RESIZE DCGUI_RESIZE_RESIZEONLY ;
ITEMSELECTED {||EditCell(oLotBrowse) }
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: AutoRefresh when
The below code (from _dcxbrow.prg) has not changed since build 255.
I suggest adding a WTF to your Refresh When block to see if it is getting evaluated.
I suggest adding a WTF to your Refresh When block to see if it is getting evaluated.
Code: Select all
METHOD DC_XbpBrowse:handleEvent( nEvent, mp1, mp2 )
IF nEvent == DCGUI_EVENT_BROWSE_REFRESH
IF ::isVisible()
IF Empty(::refreshWhenBlock) .OR. Eval(::refreshWhenBlock)
IF Valtype(::refreshBlock) == 'B'
Eval(::refreshBlock,self)
ELSE
::Refresh()
ENDIF
ENDIF
ENDIF
ELSE
RETURN ::XbpbrowseHandleEvent( nEvent, mp1, mp2 )
ENDIF
RETURN self
* --------------------
METHOD DC_XbpBrowse:setTimerRefresh()
DEFAULT ::refreshInterval := 0
IF ::refreshInterval > 0
::timer := DC_SetTimerEvent():new(::refreshInterval, ;
{||PostAppEvent(DCGUI_EVENT_BROWSE_REFRESH,,,self)})
ENDIF
RETURN self
The eXpress train is coming - and it has more cars.
Re: AutoRefresh when
[quote="rdonnay"]The below code (from _dcxbrow.prg) has not changed since build 255.
I suggest adding a WTF to your Refresh When block to see if it is getting evaluated.
Roger,
I did.. it is... when i click the button to turn autorefresh, wtf returns .f.. when it's .t., the browse is not refreshing..
slightly different browse config w/o the when clause refreshes properly..
**********************
function myautorefresh(aGetlist)
**********************
static slIsRefreshOn
IF slIsRefreshOn==nil
slIsRefreshOn:=.t.
ENDIF
IF !slIsRefreshon
wtf slIsRefreshon
ENDIF
IF !aGetlist==nil
slIsRefreshon:=!slIsRefreshOn
DC_GetObject(aGetList,'REFRESHBUTTON'):setcaption('Autorefresh '+IIF( slIsRefreshOn,"Off" ,"On" ))
ENDIF
return(slIsRefreshOn)
I suggest adding a WTF to your Refresh When block to see if it is getting evaluated.
Roger,
I did.. it is... when i click the button to turn autorefresh, wtf returns .f.. when it's .t., the browse is not refreshing..

slightly different browse config w/o the when clause refreshes properly..
**********************
function myautorefresh(aGetlist)
**********************
static slIsRefreshOn
IF slIsRefreshOn==nil
slIsRefreshOn:=.t.
ENDIF
IF !slIsRefreshon
wtf slIsRefreshon
ENDIF
IF !aGetlist==nil
slIsRefreshon:=!slIsRefreshOn
DC_GetObject(aGetList,'REFRESHBUTTON'):setcaption('Autorefresh '+IIF( slIsRefreshOn,"Off" ,"On" ))
ENDIF
return(slIsRefreshOn)
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: AutoRefresh when
Are you saying this used to work?
Now that I look at your code, I think I see the problem.
You should never toggle the value inside the WHEN code block because it will toggle every other time it's called.
This code looks confusing to me.
Now that I look at your code, I think I see the problem.
You should never toggle the value inside the WHEN code block because it will toggle every other time it's called.
This code looks confusing to me.
The eXpress train is coming - and it has more cars.
Re: AutoRefresh when
No.rdonnay wrote:Are you saying this used to work?
I just implemented autorefresh.. it worked w/ no problem, except that some users didn't like it refreshing..
so i added a button to turn on/off autorefresh.
in order to do that, i had to use the autorefresh when clause for the first time.
that's when it stopped autorefreshing.
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: AutoRefresh when
But the toggle should be on the action of the button, not in the WHEN block.
The eXpress train is coming - and it has more cars.
Re: AutoRefresh when
Roger,
i changed
AUTOREFRESH m->nBrowseRefresh WHEN {||myautorefresh()} ;
to
AUTOREFRESH m->nBrowseRefresh WHEN {||.t.} ;
and the autorefresh does NOT work..
when i take out the when clause it works..
i changed
AUTOREFRESH m->nBrowseRefresh WHEN {||myautorefresh()} ;
to
AUTOREFRESH m->nBrowseRefresh WHEN {||.t.} ;
and the autorefresh does NOT work..
when i take out the when clause it works..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: AutoRefresh when
What version of eXpress++ are you using?
I don't see anything wrong with this code.
I don't see anything wrong with this code.
The eXpress train is coming - and it has more cars.
Re: AutoRefresh when
257+
dclipx dated 8/15
dcdialog dated 7/31
dclipx dated 8/15
dcdialog dated 7/31
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: AutoRefresh when
Roger,
Are the WHEN and REFRESHBLOCK options being reversed in your GETLIST_OPTIONS array ?
Are the WHEN and REFRESHBLOCK options being reversed in your GETLIST_OPTIONS array ?