Consultor Eletrônico



Kbase P27316: How to create an updatable browser based upon a non-database
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/20/2003
Status: Unverified

GOAL:

How to create an updatable browser based upon a non-database related temp-table in a multi-paged SmartWindow?

FACT(s) (Environment):

Progress 9.x

FIX:

SmartDataBrowsers need a SmartDataObject to function as their data source. As there is no need to be connected to a database in this case, SmartDataObjects are not really the best option here. Therefore, perform the following steps in order to create an updatable browser based upon a non-database related temp-table in a multi-paged SmartWindow:

1- Fire up AppBuilder and establish a connection to a Progress database so that AppBuilder is able to create a browser object.
2- From the AppBuilder's File -> New menu, choose SmartFrame.
3- From the AppBuilder's Palette, select the browse object and place it on the created SmartFrame.
4- Hit the "Freeform Query..." button on the Query Builder Dialog.
5- Select the "Freeform. Allow freeform editing of query" option within the Progress Advisor Dialog and then hit the "Ok" button.
6- In the created SmartFrame's code definitions section, place the temp-table definition statement. e.g.:

DEFINE TEMP-TABLE tt_benefits NO-UNDO
FIELD DependentCare AS INTEGER FORMAT ">>,>>9":U
FIELD EmpNum AS INTEGER FORMAT "zzzzzzzzz9":U
FIELD HealthCare AS CHARACTER FORMAT "x(8)":U
FIELD LifeInsurance AS INTEGER FORMAT "$>>,>>>,>>>":U
FIELD MedicalSpending AS INTEGER FORMAT ">>,>>9":U
FIELD Pension401K AS INTEGER FORMAT ">>,>>9":U
FIELD StockPurchase AS INTEGER FORMAT ">>,>>9":U
INDEX EmpNo IS PRIMARY UNIQUE EmpNum ASCENDING.

7- Under the browser's OPEN_QUERY trigger, complete the unfinished OPEN QUERY Statement so that it reads records from the defined temp-table. e.g.:

OPEN QUERY {&SELF-NAME} FOR EACH tt_benefits NO-LOCK INDEXED-REPOSITION.

8- Under the browser's DISPLAY trigger, type in the name of the temp-table fields that should be displayed on the browser as well as the name of the fields that should be enabled for editing. e.g.:

tt_benefits.DependentCare FORMAT ">>,>>9":U
tt_benefits.EmpNum FORMAT "zzzzzzzzz9":U
tt_benefits.HealthCare FORMAT "x(8)":U
tt_benefits.LifeInsurance FORMAT "$>>,>>>,>>>":U
tt_benefits.MedicalSpending FORMAT ">>,>>9":U
tt_benefits.Pension401K FORMAT ">>,>>9":U
tt_benefits.StockPurchase FORMAT ">>,>>9":U
ENABLE
tt_benefits.DependentCare
tt_benefits.EmpNum
tt_benefits.HealthCare
tt_benefits.LifeInsurance
tt_benefits.MedicalSpending
tt_benefits.Pension401K
tt_benefits.StockPurchase

9- From the AppBuilder's File menu, choose the Save option to save the created SmartFrame object.
10 - From the AppBuilder's File menu, choose the Close option to close the saved SmartFrame object.
11- From the AppBuilder's Palette, hit the SmartObject icon and then choose the SmartFrame object that was just created.
12- Place an instance of the selected SmartFrame object on the desired SmartWindow's page.