Consultor Eletrônico



Kbase 16749: How to Apply Focus to a SmartWindow Run With Select-Page
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
How to Apply Focus to a SmartWindow Run With Select-Page

INTRODUCTION
============
When a SmartWindow is contained on the page of another
SmartWindow and is run with either select-page or view-page focus
does not automatically go to the called SmartWindow. You may
force focus to go to the called SmartWindow in different ways
depending on the Version of Progress you are using and depending
on the types of objects you have in the called SmartWindow.

PROCEDURAL APPROACH (8.1A AND HIGHER)
=====================================
Consider the following example:

- SmartWindow A with a SmartBrowser and a button which contains
RUN select-page(1).
- SmartWindow A also contains SmartWindow B on page 1
- SmartWindow B contains a SmartBrowser and a simple object
(fill-in)

When SmartWindow A runs and the button is chosen SmartWindow B
displays but it does not have focus. In order to force focus to
go to SmartWindow B add the following line to the button choose
trigger:

RUN notify IN THIS-PROCEDURE ('apply-entry, page1-target').

NOTE: If you have more than one smart object in page1 is better to do:
RUN dispatch IN h_window ('apply-entry').


Now when the button in SmartWindow A is chosen, SmartWindow B
appears and it has focus.

If SmartWindow B only contains SmartObjects there is one
additional step that is necessary. You need to create a
local-apply-entry internal procedure in SmartWindow B and add
the following after running the standard 'apply-entry':

RUN dispatch in h_b-order1 ('apply-entry').

Now when the button in SmartWindow A is chosen, SmartWindow B
appears and it has focus because focus has been applied to
the SmartBrowser in it.

ALTERNATIVE APPROACH (8.0A & 8.0A02)
====================================
Forcing focus to the second SmartWindow is not possible in 8.0
with the above approach.

If there is a simple object on the second SmartWindow you can
do the following in the local-initialize of the second
SmartWindow to have focus go to it when it is run:

APPLY "FOCUS" TO FILL-IN-1 IN FRAME {&FRANE-NAME}.


Progress Software Technical Support Note # 16749