Consultor Eletrônico



Kbase P4026: How to reposition a SmartDataBrowser linked to a SmartDataObject to a specific record if the query h
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/17/2004
Status: Verified

GOAL:

How to reposition a SmartDataBrowser linked to a SmartDataObject to a specific record if the query has been closed and reopened?

GOAL:

Repositioning a SmartDataBrowse linked to a SmartDataObject to a specific record.

GOAL:

Repositioning a SDB linked to a SDO to a specific record.

FACT(s) (Environment):

Progress 9.x
OpenEdge 10

FIX:

The example below is based on the sports2000 database.

1. SDO for customer, fields custnum name.
1. SDB linked to the SDO.
1. SW with the SDO and SDB
1. Button to process.

The windows should contain 1 SDO, 1 SDB, 1 Button.

The objective is by pressing the button to keep the record which is selected in the browser, close the query, reopen the query and redisplay the row selected in the browser.

In the trigger choose of the button I do:
RUN SHOWMYROW in h_dsdo.

Where h_dsdo is the handle to the SDO.

In the SDO I put the following code in the procedure section and I call it SHOWMYROW:

/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEF VAR w_custnum LIKE rowobject.custnum.

w_custnum = rowobject.custnum.

DYNAMIC-FUNCTION('closeQuery':U).

DYNAMIC-FUNCTION('openQuery':U).

FIND FIRST ROWOBJECT WHERE ROWOBJECT.custnum = w_custnum NO-ERROR.

IF AVAILABLE rowobject THEN do:
DYNAMIC-FUNCTION('findRow':U,INPUT w_custnum).
END.

END PROCEDURE.

The solution is to keep the key field of the record into a var and to use the DYNAMIC-FUNTION 'findrow'.

Dynamic-function 'findrow' could be found in data.p.