Data Flow In Depth

The Program to User Round Trip

The dataflow that carries field and indicator values from the program to the user involves four buckets:

  1. RPG Program Variables
  2. DataSet
  3. Web Control properties
  4. HTML elements

When going from the program to the browser, the dataflow steps are:

  • Busines Logic affects RPG Program Variables
  • Write Record copies the variables to the DataSet
  • OnCopyDisplayFileToBrowser copies the DataSet values to the Web Control
  • Render method generates the HTML stream

On the way back, from browser to program, the steps are:

  • Browser sends input values to the server, which get copied to the Web Controls
  • OnCopyBrowserToDisplayFile copies the values to the DataSet
  • The DataSet values are copied to the RPG program variables when the RPG program READs

If your application must manipulate the data in the DisplayFile code behind, it can utilize the values when they are in either the DataSet or in the Web Control properties. Typically this is done by overriding the OnCopyxxx methods. The ASNA.Monarch.WebDspf.Page makes available its DataSet via a property conveniently called DataSet, it also provides a set of methods to facilitate the manipulation of the values in the DataSet. The DataSet values and the methods can be used after the *Base.OnLoad has executed.

Indicator values have additional considerations:

Each record format holds two sets of indicators (100 each): "Option" and "Response" indicators.

The "Option" indicators are used by the RPG program to affect the initial state of fields in the record format. These are used when the record is Written (sent to the Browser). Note that ExFmt command implies a Write).

The "Response" indicators indicate to the RPG program, the state of fields in which the user responded by using the active records while the Browser page was presented and the response was submitted to the server. These are used (affecting the RPG indicators) when active record formats are Read (through various RPG/AVR commands, such as coming back from ExFmt, ReadC, et c.)

Dataflow of Indicators in DataTable

  1. RPG Program Write-Record operation sets indicators in DataTable with the values of the indicators of the RPG program




  2. Code Behind SetIndicator() can override DataTable option Indicators




  3. On *Base.OnCopyDspFileToBrowser uses the indicators as option indicators to affect the behavior of the DdsControls




  4. On *Base.OnCopyBrowserToDspFile sets the indicators as resulting indicators with values of 1-0-x depending if the indicator was used by the DdsControls of the Record




  5. Code Behind SetIndicator() can override DataTable respone Indicators (with 1-0-x values)




  6. RPG Program Read-Record operation Sets the indicators of the RPG Program with the '1' and '0' in the DataTable, 'x' values are ignored




Related Methods

These methods can impact field and indicator values after the *Base.OnLoad has executed, for instance in:

  • OnCopyDspFileToBrowser
  • OnCopyBrowsertoDspFile

And occasionally in:

  • OnLoad
Method that Tests for Active Format

IsFormatActive

Bool IsFormatActive(FormatName)
Methods that Get Data

GetDataTable

DataTable GetDataTable(FormatName)

GetDataRow

DataRow GetDataRow(FormatName)

GetSubfileDataRow

DataRow GetSubfileDataRow(FormatName, RRN)

GetFieldValue

Object GetFieldValue(FormatName, FieldName)

GetSubfileFieldValue

Object GetSubfileFieldValue(FormatName, FieldName, RRN)
Methods that Set Field Values

SetFieldValue

SetFieldValue(FormatName, FieldName, Object newValue)

SetSubfileFieldValue

SetSubfileFieldValue(FormatName, FieldName, RRN, Object newValue)
Methods that Get Indicators

GetOptionIndicator

Char = GetOptionIndicator(FormatName, indicator (1->99))

aGetOptionIndicators

Char [100] = GetOptionIndicators(FormatName)

GetResponseIndicator

Char = GetResponseIndicator(FormatName, indicator (1->99))

GetResponseIndicators

Char [100] = GetResponseIndicators(FormatName)

GetSubfileOptionIndicator

Char = GetSubfileOptionIndicator(FormatName, RRN(1->), indicator (1->99))

GetSubfileOptionIndicators

Char [100]= GetSubfileOptionIndicators(FormatName, RRN (1->))

GetSubfileResponseIndicator

Char = GetSubfileResponseIndicator(FormatName, RRN(1->), indicator (1->99))

GetSubfileResponseIndicators

Char [100]= GetSubfileResponseIndicators(FormatName, RRN (1->))
Methods that Set Indicators

The Setting indicator functions will rise an exception if they are called between *Base.OnCopyDspFileToBrowser and *Base.OnCopyBrowserToDspFile is irrelevant.

SetOptionIndicator

SetOptionIndicator(string FormatName, indicator (1->99), char newValue01)

SetResponseIndicator

SetResponseIndicator(string FormatName, indicator (1->99), char newValue01X)

SetSubfileOptionIndicator

SetSubfileOptionIndicator(FormatName, RRN(1->), indicator (1->99), char newValue01)

SetSubfileIndicator

SetSubfileResponseIndicator(FormatName, RRN(1->), indicator (1->99), char newValue01X)

See Also

Reference Library
WebDspf.Page Class
Page Class Methods