Page.OnCopyDspFileToBrowser Method

Allows you to intervene when data is being copied from the display buffer data sent to the 'dds' controls in the page. The Response is formulated here.

Syntax

BegSr OnCopyDspFileToBrowser Modifier(*Overrides) Access(*Protected)

Remarks

The OnCopyDspFileToBrowser callback subroutine executes right before the workstation data is sent from the Web Server to the Client (browser).

Example

In the example below, OnCopyDspFileToBrowser uses the DspF field of the base class to get ahold of the current display file that has a reference to the dataSet. Use uppercase names to get to the table corresponding to a record format and to get to columns of a row. A record is considered active if its table has at least one row.

When overriding OnCopyDspFileToBrowser, it is very important to call the base subroutine as indicating below; missing such call would result in fields in the browser not initialized to the values according to the RPG program.

In the example below, workstation record format name "FMT003" is checked; if active, the dataSetRow where the data for record FMT0003's fields is stored, gets passed to a "shared" subroutine in the class "WindowWidget", so that a non-DDS asp control, RadioButtonList (with id="FMT003_SCNOTPTY_RADIOS"), gets prepared with the choice controls's fields, to achieve an enhanced User Interface.

BegSr OnCopyDspFileToBrowser Modifier(*Overrides) Access(*Protected)
       If (DspF.dataSet.Tables["FMT003"].Rows.Count > 0 )
           WindowWidget.PrepareSngChoiceSelection(DspF.dataSet.Tables["FMT003"].Rows[0], "SCNOTPTY",FMT003_SCNOTPTY_RADIOS )
           WindowWidget.PrepareSngChoiceSelection(DspF.dataSet.Tables["FMT003"].Rows[0], "SCCPYOPT",FMT003_SCCPYOPT_RADIOS )
           WindowWidget.PrepareMltChoiceSelection(DspF.dataSet.Tables["FMT003"].Rows[0], "SCPRTOPT",FMT003_SCPRTOPT_CHECKBOXES ) 
       EndIf
   *base.OnCopyDspFileToBrowser()   
EndSr

Notes

The implementation of class "WindowWidget" is not shown in this example (it can be requested to tech-support if desired). The first parameter for WindowWidget.PrepareSngChoiceSelection is declared as:

DclSrParm elements Type(System.Data.DataRow)

for operations such as:

If elements["CHCTLFLD"] = "1"     
     radio.Selected = *true
EndIf

Requirements

Namespace: ASNA.Monarch.WebDspF

Assembly: ASNA.Monarch.WebDspF.DLL

Platforms: Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows 7, Windows 8 Pro, Windows 10 Pro