Kbase P1092: ADM2. How to Enable Disable Columns of an Updatable SmartDataBrowser?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/12/2004 |
|
Status: Unverified
GOAL:
How to Enable Disable Columns of an Updatable SmartDataBrowser with ADM2?
GOAL:
How to Enable Columns of an Updatable SmartDataBrowser with ADM2?
GOAL:
How to Disable Columns of an Updatable SmartDataBrowser with ADM2?
FACT(s) (Environment):
Progress 9.1x
OpenEdge 10
Windows 32bit
FIX:
Here are the steps to Enable or Disable Columns of an Updatable SmartDataBrowser.
1. Create and SDO (SmartDataObject) to the table we want to Query. (i.e. Customer table and add, custnum, name, and city), only Name is updatable.
2. Create a Browser Based on that SDO, and select all fields.
3. Set the Customer.NAME in the browse, Customer.Name to ENABLED.
4. Place your SDO, SDB in a SmartWindows, accept the links.
5. Add 2 Buttons bt1 label "Enable NAME" and bt2 label "Disable Name" to the SW.
6. Add the following code to bt1.
RUN ENABLENAME IN browserhandel.
Where browserhandel is the handle to the browser and ENABLENAME is a Proccedure to enable the NAME column in the Browse.
7. Add the following code to bt2.
RUN DISABLENAME IN browsehandle.
Where browsehandle is the handle to the browser and DISABLENAME is a Proccedure to disable the NAME column in the Browse.
8. Edit the SDB and add 2 new procedures to the browser.
PROCEDURE ENABLENAME
DO:
def var h1 as handle.
h1:BROWSE {&BROWSE-NAME}:GET-BROWSE-COLUMN(2).
h1:READ-ONLY = TRUE.
END.
PROCEDURE DISABLENAME
DO:
def var h1 as handle.
h1:BROWSE {&BROWSE-NAME}:GET-BROWSE-COLUMN(2).
h1:READ-ONLY = FALSE.
END.