Row Refresh in a BROWSE

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Red2
Posts: 91
Joined: Sat May 18, 2019 2:11 pm
DBs Used: DBF, FoxPro, Visual FoxPro
Location: United States (East Coast)
Has thanked: 34 times
Been thanked: 4 times

Row Refresh in a BROWSE

Post 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

User avatar
Anand
Posts: 495
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 190 times
Been thanked: 79 times

Post by Anand »

I think you can call
brow_data:Refresh(.T.)
for it

Regards,

Anand
Image

User avatar
mol
Posts: 3359
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 256 times
Been thanked: 163 times
Contact:

Post by mol »

Refresh causes refreshing whole BROWSE control and screen flickering

User avatar
Anand
Posts: 495
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 190 times
Been thanked: 79 times

Post by Anand »

Then maybe
brow_data:Refresh(.f.)

I mixed up.

Regards,

Anand
Image

User avatar
AUGE_OHR
Posts: 874
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 132 times
Been thanked: 218 times

Post 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.
have fun
Jimmy

User avatar
mol
Posts: 3359
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 256 times
Been thanked: 163 times
Contact:

Post by mol »

Is it valid for BROWSE control?

User avatar
Anand
Posts: 495
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 190 times
Been thanked: 79 times

Post 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
Image

User avatar
mol
Posts: 3359
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 256 times
Been thanked: 163 times
Contact:

Post by mol »

Tsbrowse is absent in HMG

Red2
Posts: 91
Joined: Sat May 18, 2019 2:11 pm
DBs Used: DBF, FoxPro, Visual FoxPro
Location: United States (East Coast)
Has thanked: 34 times
Been thanked: 4 times

Post 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

mlnr
Posts: 106
Joined: Fri Aug 28, 2015 1:52 pm
DBs Used: DBF
Location: Hungary
Has thanked: 33 times
Been thanked: 13 times

Post by mlnr »

Please try this

Code: Select all

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

Post Reply