Kbase P158737: Editor Widgets that are data bound to temp-tables defined in the AppBuilder's Procedure settings do
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  28/07/2010 |
|
Status: Unverified
SYMPTOM(s):
Using SmartFrame with temp-table defined in the Procedure Settings
Editor widgets added to SmartFrame and bound to fields in the temp-table
READ-ONLY attribute of the Editor widgets is ignored at runtime
FACT(s) (Environment):
OpenEdge 10.1x
OpenEdge 10.2x
Windows
CAUSE:
Due to a change in the ADM2 framework for Dynamics, Editor widgets that are data bound to temp-tables defined in the Procedure Settings do not honor the READ-ONLY settings in the Editor widgets property sheet
FIX:
To resolve this issue do the following:
- Copy %DLC%\src\adm2\visualcustom.i and visualcustom.p out of %DLC% into src\adm2\custom under your application source path (above the installed adm2 code)
- Create an <applicationdir>\adm2\custom folder where the r-code for visualcustom.r will reside
- Open <applicationdir>\src\adm2\custom\visualcustom.i and uncomment the line in the main block that reads:
/* IF NOT {&ADM-LOAD-FROM-REPOSITORY} THEN
RUN start-super-proc ("adm2/custom/visualcustom.p":U).*/
- Create an updateFieldProperties internal procedure in <applicationdir>\src\adm2\custom\visualcustom.p and place the following code into that internal procedure:
DEFINE VARIABLE hdlFrame AS HANDLE NO-UNDO.
DEFINE VARIABLE hdlField AS HANDLE NO-UNDO.
DEFINE VARIABLE chrAllFieldNames AS CHARACTER NO-UNDO.
DEFINE VARIABLE chrEditorsNotRO AS CHARACTER NO-UNDO.
{get AllFieldNames chrAllFieldNames}.
{get ContainerHandle hdlFrame}.
IF chrAllFieldNames = '':U AND VALID-HANDLE(hdlFrame) THEN DO:
/* If window then this is container class, so get the main frame */
IF hdlFrame:TYPE = "WINDOW":U THEN
{get WindowFrameHandle hdlFrame}.
IF VALID-HANDLE(hdlFrame) THEN
hdlField = hdlFrame:FIRST-CHILD:FIRST-CHILD.
/* widgetloop */
DO WHILE VALID-HANDLE(hdlField):
IF hdlField:TYPE = 'EDITOR':U AND hdlField:READ-ONLY = NO THEN
chrEditorsNotRO = (IF chrEditorsNotRO > '':U THEN
chrEditorsNotRO + ',':U + STRING (hdlField)
ELSE
STRING (hdlField)).
hdlField = hdlField:NEXT-SIBLING.
END. /* DO WHILE VALID-HANDLE(hdlField) */
END. /* IF chrAllFieldNames = '':U AND VALID-HANDLE(hdlFrame */
RUN SUPER.
gintEntries = NUM-ENTRIES (chrEditorsNotRO).
DO gintEntry = 1 TO gintEntries:
hdlField = WIDGET-HANDLE(ENTRY (gintEntry,chrEditorsNotRO)) NO-ERROR.
IF VALID-HANDLE(hdlField) THEN
hdlField:READ-ONLY = NO.
END.
- Compile the r-code for <applicationdir>\src\adm2\custom\visualcustom.p into <applicationdir>\adm2\custom
- Re-compile all visual application code (SmartFrames, SmartWindows, SmartDataViewers, SmartDataBrowsers, etc...), as it includes visual.i, which includes src/adm2/custom/visualcustom.i