Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Brows List Boxes - How do I refresh them from another window? 1

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
US
Hi Everyone,

I have many windows open in my application. Can you tell me how to refresh the listbox in one of those windows from a different window? I plan to put in in an accepted embed. Also I would like to use an if statement to dermine if a particular window is open. Can you tell me what to put in the if statement?

Thanks.

Emad
 
Hi Emad,

A easy way to find out which Windows are open is to have a Global queue or Global Variables to record their Open status. A way of refreshing a ListBox is by sending a POST() or NOTIFY() command to the corresponding thread. Please look in the help for more information.

A posting made by someone in the NG on the use of NOTIFY
--------------------------------------------------------
I use NOTIFY and NOTIFICATION for this.

Create a global LONG to hold the thread of the window

THREAD:MyBrowse

I usually also create my Notify commands as global equates

NC_CloseWindow EQUATE( 100 )


In the OpenWindow embed of the browse, put:

THREAD:MyBrowse = THREAD()


On the browse you need two local variables:

NCode UNSIGNED
NParam LONG

On the browse embed for EVENT:Notify put:

IF NOTIFICATION( NCode, NParam)
CASE NCode
OF NC_CloseWindow
POST( EVENT:CloseWindow )
END
END

Back on your button on the appframe, put this in the embed

NOTIFY( NC_CloseWindow, THREAD:MyBrowse )


You should note that you can do a similar task by using POST to post an event to the browse thread (identify it in a similar manner), but if your not using NOTIFY you should look at the docs and get used to it.

It is a better method and also allows you to pass a LONG as a parameter to the NOTIFICATION event.

This is a very powerful feature and quite useful IMHO.
-----------------------------------------------------------

Regards
 
Hi ShankarJ,

Thanks for the help. I will create code based on your examples.

Truly,
Emad
 
Hi there,

I have an old lecacy app where I need to refresh a browse, any ideas as to what I can use, something similar to ResetFromFile/ResetFromQueue in Abc?

Regards

Rudi
 
Hi Rudi,

I think a

Code:
ForceRefresh = True
DO RefreshWindow

should do.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top