AutoFresh GetList

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

AutoFresh GetList

#1 Post by PedroAlex »

hello,

I have a small program to receive data from a client.exe program via websocket.
This program is for a Customer DualDisplay POS system.
The program AbDisplay.exe receive de data but I need to refresh the getlist without clicking the button.
What I want is that when data is entered the abdisplay autorefresh the getlist.

This is possible!?

Many thanks..
Attachments
PRG.rar
(661.45 KiB) Downloaded 544 times
Pedro Alexandre

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: AutoFresh GetList

#2 Post by rdonnay »

Why is it not possible for you to use DC_GetRefresh(GetList).
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: AutoFresh GetList

#3 Post by PedroAlex »

Roger,

Maybe it didn't explain well..

I want a passive small program without any buttons and without user intervention.
How can i refresh the getlist without user intervention?

Edit abdisplay.prg and delete or disable the pushbutton comand and compile.
than run abdisplay.
than run cliente.exe and send a message.
The abdisplay receive the message but the getlist does not refresh the browse and the gets.

The dcbrowse have "Autorefesh" but this does not refresh the gets..

Many thanks
Pedro Alexandre

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: AutoFresh GetList

#4 Post by rdonnay »

Do the following:

Code: Select all

Public GetList := {}

Procedure MAIN()
LOCAL GetOptions   //, GetList := {}  << GetList is now PUBLIC


METHOD EchoServer:onBinary( cBinary )

xData := Bin2Var(cBinary)

	IF Len( xData ) > 0
		cNomeArtigo := xData[1]
		nQtd        := xData[2]
		nPvp        := xData[3]
		nTotal      := nQtd*nPvp
		nGTotal     += nTotal
		aadd( aConta, {nQtd,cNomeArtigo,nTotal} )
            DC_GetRefresh(GetList)  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	Endif

RETURN self
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: AutoFresh GetList

#5 Post by PedroAlex »

I had already tried this way..

[img][/[img]
Attachments
EE.jpg
EE.jpg (42.77 KiB) Viewed 9172 times
Pedro Alexandre

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: AutoFresh GetList

#6 Post by rdonnay »

Here is a solution that will work.
This one has been tested.

I had not tested the last solution I gave you.
It appears that Xbase++ didn't like refreshing the main thread directly from the EchoClient thread.

I have had this problem in many other apps and always solved the problem by pushing an event into the thread that contains the main window.

This is done by adding the following code: (files are attached).

#define REFRESH_GETLIST xbeP_User + 100
...
Public oMainWindow
...
DCUSEREVENT REFRESH_GETLIST ACTION {||DC_GetRefresh(GetList)}
...
DCREAD GUI .. PARENT @oMainWindow
...
PostAppEvent(REFRESH_GETLIST,,,oMainWindow)
Sleep(10)
Attachments
PedroAlex.zip
(3.78 KiB) Downloaded 536 times
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: AutoFresh GetList

#7 Post by PedroAlex »

Roger,

Thank you very much.
It works very well.
Pedro Alexandre

Post Reply