Kbase 15880: Display Custom Message from a Smart Panel
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Display Custom Message from a Smart Panel
There are a number of ways to display a custom message that
includes the table name on DELETE of a record from a
SmartPanel.
The first way is to create a custom SmartPanel. The
SmartPanel can request the EXTERNAL-TABLES of its
Tableio-Target (using request-attribute IN adm-broker-hdl).
Generally speaking, the table being deleted is the first entry
of this list.
ON choose OF btn_delete
DO:
/* Get the first external-tables in the Tableio-Target. */
RUN request-attribute IN adm-broker-hdl
(THIS-PROCEDURE, 'Tableio-Target',
'External-Tables').
MESSAGE "Ok to delete " ENTRY(1, RETURN-VALUE, " ":U) "?"
VIEW-AS ALERT-BOX QUESTION BUTTONS OK-CANCEL
UPDATE l_answer AS LOGICAL.
IF l_answer THEN RUN notify ('delete-record').
END.
This logic assumes that the table being deleted is the
first external table. This won't always be true. The table
being deleted is the FIRST-ENABLED-TABLE in the
SmartViewer. There's no ENABLED-TABLES attribute in 8.0
(there will be in 8.1) so you have to use EXTERNAl-TABLES.
If there were multiple tables in the target you wouldn't
know which one was the enabled table whose record was being
deleted.
The alternative method would be to augment the ADM delete
method with a new custom delete-record. To do this you would
need to create a new tableio.i that contains the new "custom"
delete-record. For example the new delete-record could have:
MESSAGE "Ok to delete " "{&adm-tableio-table" "?"
VIEW-AS ALERT-BOX QUESTION BUTTONS OK-CANCEL
UPDATE l_answer AS LOGICAL.
IF l_answer THEN RUN dispatch IN
THIS-PROCEDURE ('delete-record').
The steps to modify the adm code are documented in the UIB
Developers Guide, Section 13.3.2 and in KBASE 15815,
Modifying ADM Support Code.
Progress Software Technical Support Note # 15880