Setting focus to a browse

Posted by Admin on 12-Nov-2008 07:35

A problem with a Dynamics-program:

I have an independent window with 3 browses. From this window I can launch a dependent window, and when i close this dependent window, I want the first browse to have focus, no matter which browse originally had the focus when the dependent window was launched. I just can't seem to get this to work.

What I have done so far: In destroyObject in the dependent window I publish an event called setFocusToMainBrowse. In initializeObject of the superprocedure of the independent window I subscribe to this procedure, and implements it.

In the procedure setFocusToMainBrowse (which is actually run when the dependent window terminates, so far so good), I try to set focus to browse1. The first thing I tried was simply 'assignFocusedWidget('browse1')', which didn't work. I then tried to get a handle to the browse by using widgethandle, but it returned '?'. I finally got the handle of the browse by running through all objects in the window and checking for name='browse1', but when i try to 'APPLY "ENTRY" to lhaBrowseHandle' nothing seems to happen.

Any suggestions?

All Replies

Posted by Admin on 19-Nov-2008 08:27

Found it!

As mentioned I found the procedure-handle of the browse (?) by looping through all components of in the window and checking against the name, then i did this:

Run applyEntry in lhaBrowseHandle

where lhaBrowseHandle is the handle of the browse.

This thread is closed