Consultor Eletrônico



Kbase 16269: Creating navigations links from menu-items to SmartObjects
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Creating navigations links from menu-items to SmartObjects

In an application that uses SmartObjects a developer might want
a SmartWindow to have menu-items that navigate through the records
displayed in a SmartViewer, which in its turn is linked to a
SmartQuery and a SmartNavigationPanel.

The menu might look like this:

Navigation...
First
Previous
Next
Last

A common error is that the developer tries to APPLY something
to a button in the SmartNavigationPanel. This was and is still
not good practice. One should avoid as much as possible to
APPLY UI events to any object.

The correct implementation is to have the SmartWindow to be an
additional Navigation source for the SmartQuery. This is done
by entering the following code in the CHOOSE triggers of the
different menu-items:

RUN dispatch IN <handle of the SmartQuery> ("get-first").
" " " " ("get-prev").
" " " " ("get-next").
" " " " ("get-last").

Another, maybe even better approach, is to create a Navigation
Link from the SmartWindow to the SmartQuery and replace the code
mentioned above by:

RUN notify ("get-first").
" " ("get-prev").
" " ("get-next").
" " ("get-last").

An additional benefit of this approach is that the SmartNaviga-
tionPanel can be taken out of the SmartWindow and the user will
still be able to navigate through the records with the menu-items
available.


REFERENCES TO WRITTEN DOCUMENTATION:
===================================
User Interface Builder Developer's Guide
Programming Handbook

Progress Software Technical Support Note # 16269