Consultor Eletrônico



Kbase 19431: ADM2 - Ways to Simulate SmartPanel Save Button Behavior
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/20/2000
KnowledgeBase Number: 19431
Creation Date: 19-JAN-00
Modified Date:
This document applies to: Progress ADM2 Functionality
Version and Release Number: Version 9.0A and Higher

Summary: This Knowledgebase Entry describes a few different
methods of emulating the behaviour of the save button in the
SmartPanel(pupdsav).

Step by Step Details: When the Save button is pressed on the
SmartPanel, it simply publishes "updateRecord" which fires off a chain
of procedures/functions in procedures which subscribe to that event.
In Effect, by creating a TableIO link from the SmartPanel to a visual
object (like a viewer), you are subscribing that object to the events,
including "updateRecord", that the Panel publishes.

You can invoke this same behaviour programatically without having to
know the Technical Details of how, why and what the publish and
subscribe process works with SmartObjects. Below are 3 general
scenarios which require 3 different approaches.

Scenario 1.
SmartWindow contains the following:

SmartDataObject with "Data" and "Update" links to a
SmartDataViewer with NO SmartPanel Present,
and a simple button on the Window(Save Button).

NOTE: In this case you want the Save Button to directly publish the
event that the Save button on the SmartPanel would do.

Solution1.
1. In the SmartLink Editor, create a TableIO link from the Window to
the Viewer.
2. In the Trigger code for CHOOSE of the button do the following:
PUBLISH "updateRecord".

Scenario2.
SmartWindow contains the following:

SmartDataObject with "Data" and "Update" links to a
SmartDataViewer WITH a SmartPanel present and linked to the
Viewer with a TableIO Link.
This Window also has a button on the Window(Save Button).

NOTE: In this case you want the Save Button to publish the event for
the SmartPanel. You can't create a second TableIO link to the viewer
as it can have only one TableIO source.

Solution2.
1. In the Trigger Code for CHOOSE of the button do the following:
PUBLISH "updateRecord" FROM h_pupdsav.

Scenario3.
SmartWindow contains the following:

SmartDataObject with "Data" and "Update" links to a
SmartDataViewer. Viewer contains a button(Save Button).
In this scenario, the presence of a SmartPanel is irrelevant.

Solution3.
1. In the trigger code for CHOOSE of the button do the following:
RUN updateRecord.