Page 1 of 3

Row Refresh in a BROWSE

Posted: Fri Jun 26, 2020 4:52 pm
by Red2
Hi,

In a (simple) BROWSE the ACTION of a right-click calls the following function.

Code: Select all

function Browse_Field_Change( p_lPrint)
	if ( p_lPrint )		// TRUE
		if ( upper( By_State->MergeState ) != "Y" )
			replace By_State->MergeState with "Y"
		endif
	else			// FALSE
		if ( By_State->MergeState != " " )
			replace By_State->MergeState with " "
		endif
	endif
	// Refresh the current BROWSE row!!!
return Nil
The value of field MergeState is correctly changed.
PROBLEM: I have not been able to dynamically make this row's change appear in the BROWSE.

It does not appear in the BROWSE until I
1) exit the form
then
2) Re-open the form

QUESTION:
In HMG/Harbour how can I dynamically refresh the current BROWSE row (whose value(s) have changed)?

Thank you for your kind guidance and suggestions.

Regards,
Red2

Re: Row Refresh in a BROWSE

Posted: Sat Jun 27, 2020 9:07 am
by Anand
I think you can call
brow_data:Refresh(.T.)
for it

Regards,

Anand

Re: Row Refresh in a BROWSE

Posted: Sat Jun 27, 2020 4:56 pm
by mol
Refresh causes refreshing whole BROWSE control and screen flickering

Re: Row Refresh in a BROWSE

Posted: Sat Jun 27, 2020 5:20 pm
by Anand
Then maybe
brow_data:Refresh(.f.)

I mixed up.

Regards,

Anand

Re: Row Refresh in a BROWSE

Posted: Sat Jun 27, 2020 7:15 pm
by AUGE_OHR
hi,
Refresh Method
Refresh Content For a Data-Bound Control

Syntax:
<WindowName>.<ControlName>.Refresh

Data-bound Grid supports an optional logical parameter. When set to .t., the selected logical records is preserved.
so when using Parameter .T. it only update Record (refreshCurrent) and not hole Display.

Re: Row Refresh in a BROWSE

Posted: Sun Jun 28, 2020 9:12 am
by mol
Is it valid for BROWSE control?

Re: Row Refresh in a BROWSE

Posted: Sun Jun 28, 2020 9:48 am
by Anand
Sample c:\MiniGUI\SAMPLES\Advanced\Tsb_Basic\ of Harbour MiniGUI Extended Edition uses
oBrw:Refresh(.T., .T.)
so it is valid.

But do not know about HMG 3.4.4

Regards,

Anand

Re: Row Refresh in a BROWSE

Posted: Sun Jun 28, 2020 1:20 pm
by mol
Tsbrowse is absent in HMG

Re: Row Refresh in a BROWSE

Posted: Sun Jun 28, 2020 1:59 pm
by Red2
Thank you so much for your very kind help and the suggestion: brow_data:Refresh(.f.).
(Note: My BROWSE is a simple Browse, not a TBrowse or a GRID).

Unfortunately I remain UNsuccessful.

My BROWSE is defined (named) as "BrowseStates" so I tried the following syntax. Question: Is my syntax/implementation wrong?

Code: Select all

BrowseStates:Refresh(.F.) // This generates the error "Error BASE/1003  Variable does not exist:  BROWSESTATES".  
I notice that the sample PRGs in Harbour MiniGUI Extended Edition, c:\MiniGUI\SAMPLES\Advanced\Tsb_Basic\Demo.PRG, include the line

Code: Select all

#include "TSBrowse.ch"
In HMG can a simple BROWSE actually be refreshed?????

Finally
The HMG .CHM help file shows a "Refresh Method", <WindowName>.<ControlName>.Refresh. It is described as "Refresh Content For a Data-Bound Control". My form/window is (named) "DataBrowse". However

Code: Select all

DataBrowse.BrowseStates.Refresh(.T.) // Generates error "Error BASE/1003  Variable does not exist: DATABROWSE"
Can anyone suggest, in HMG, a way to code a REFRESH in a "normal" BROWSE? I would be very much appreciate your your expert advice.

Thanks again!
Red2

Re: Row Refresh in a BROWSE

Posted: Sun Jun 28, 2020 3:41 pm
by mlnr
Please try this

Code: Select all

DoMethod("DataBrowse","BrowseStates","Refresh")
But as Marek wrote screen flickering.