Consultor Eletrônico



Kbase P98390: Navigation buttons not enabled after saving a row if SDO openOnInit = FALSE
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   09/06/2005
Status: Unverified

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x
Dynamics

SYMPTOM(s):

Navigation buttons are disabled when container is initialized

Navigation buttons stay disabled after a new row is added

Using ADM2

Standard Toolbar has navigation link to SDO

SDO has OpenOnInit set to False

CAUSE:

What happens is this:
- Because OpenOnInit = False the container is unaware records are available, thus navigation is disabled when the container is initialized.
- New row is added to the SDO.
- When the row is committed to the database it will be refreshed after the commit, but as it was already in the result set of the SDO no other data is fetched.
- As far as container is concerned, only one row is available at this time - the one just added. As there is nothing else to navigate to, the navigation remains disabled.

If multiple rows is added the navigation will be enabled. However, due to the behavior described above, it will only be possible to navigate between the new rows.

CAUSE:

Enhancement Request# 20041231-001

FIX:

For improved behavior of saving rows when SDO has openOnInit = FALSE, implement a customization on submitRow along the following lines:

PROCEDURE submitCommit:
/*------------------------------------------------------------------------------
Purpose: Customization to automatically open query and reposition after
add if OpenOnInit = No.
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER pcRowIdent AS CHARACTER.
DEFINE INPUT PARAMETER plReopen AS LOGICAL.
DEFINE VARIABLE cRowIdent AS CHARACTER NO-UNDO.
DEFINE VARIABLE lQueryOpen AS LOGICAL NO-UNDO.
RUN SUPER (pcRowIdent,plReopen).
{get queryOpen lQueryOpen}.
IF NOT lQueryOpen THEN DO:
{get rowIdent cRowIdent}.
dynamic-function("openQuery" IN TARGET-PROCEDURE).
dynamic-function("fetchRowIdent" IN TARGET-PROCEDURE,cRowIdent,"").
END.
END PROCEDURE.

This will ensure that after adding a new row, the SDO query is opened and the full batch of data containing this new row will be fetched. Linked smartObjects will recognize this and respond as appropriate.

Note that submitRow executes on the client-side of the SDO, so this approach will result in additional AppServer hits.

The enhancement request was logged to further improve the behavior of an SDO with openOnInit = FALSE, keeping the processing on the server side if possible.