OnManualLoadData - cWebList

Allows for manual loading of grid row data

Type: Event

Parameters: tWebRow[] ByRef aTheRows String ByRef sCurrentRowID tWebGroupConfig[][] ByRef aTheGroups tWebGroupHeader[][][] ByRef aTheGroupHeaders

aTheRows (ByRef)Array of tWebRow members to be populated. This is the grid data. Should contain one array member for each column, starting with array member 1 for column one. aValues[0] should be populated with a unique RowID.
sCurrentRowID (ByRef)[ToDo: In Progress]
aTheGroups (ByRef)[ToDo: In Progress]
aTheGroupHeaders (ByRef)[ToDo: In Progress]

Procedure OnManualLoadData tWebRow[] ByRef aTheRows String ByRef sCurrentRowID tWebGroupConfig[][] ByRef aTheGroups tWebGroupHeader[][][] ByRef aTheGroupHeaders


The OnManualLoadData event is used to populate a grid or list with data. You would use OnManualLoadData whenever the grid is not populated via a Server DataDictionary object (DDO).

You must specify that a grid or list is to be manually loaded by either setting pbDataAware to False or setting peDbGridType to gtManual. Refer to these topics to understand the purpose of each of these settings.

The OnManualLoadData event passes back an array of tWebRow structs, where each array member represents a row of column data for the list. The order of array members will determine the order of rows.

The tWebRow - aCells member is the array you will need to populate to represent the column values for each row. The 0th element of this array represents the leftmost column.

The tWebRow - sRowID member should be populated with a value that is unique for each row. You may set this to any value you wish as long as each row has a unique value.

Other members of tWebRow and the aCells array are available for configuring the data and its appearance. Refer to the tWebRow and tWebCell topics for further details.

The sCurrentRowID parameter can be set to specify the RowID of the row you wish to be initially selected as the grid's current row.


Procedure OnManualLoadData tWebRow[] ByRef aTheRows String ByRef sCurrentRowID
    Forward Send OnManualLoadData (&aTheRows) (&sCurrentRowID)
    String sArtist sAlbum sTrash
    Number nSize nLength 
    Integer iID iCount iStartId
    Direct_Input "ManualData.Csv"
    Move 0 to iCount
        Readln iID sPlanet sAlbum nSize nLength sTrash
        If (iCount = 0) move iId to iStartId
        If (Trim(sArtist) <> "") Begin
            //  Decode data                             
            Move iID to aTheRows[iCount].sRowID
            Move "sPlanetStyle" to aTheRows[iCount].sCssClassName
            Move sPlanet to aTheRows[iCount].aCells[0].sValue
            Move (ConvertToClient(typeNumber, nSize)) to aTheRows[iCount].aCells[1].sValue
            Increment iCount                                
    Until (SeqEof)
    Set_Attribute DF_DECIMAL_SEPARATOR to iDecSep
    // tell the list which RowID to select after it is loaded.
    Move iStartId to sCurrentRowID

The above sample demonstrates a web view containing a list whose rows and columns are 'manually' populated with code. We call this a non-data-aware list, i.e. it is not connected to any data dictionary server and its columns do not have any data binding.

The sCurrentRowID parameter is set to the first row read in. This means that row number will be selected as the initial current row.

The OnManualLoadData event is not automatically fired. You will need to write code in your view to trigger it. Typically, you would augment the grid or list's OnLoad event to do this by signaling the client to perform a GridRefresh. This will load the grid data loaded in OnManualLoadData when the grid is first activated.

Procedure OnLoad
    Forward Send OnLoad    
    Send GridRefresh

In the above example, the grid's OnLoad event will signal the client that the grid needs to refresh its data. The client will respond to this by sending the OnManualLoadData event to the server and will populate its rows with the returned data set.

If you wish to manipulate the grid's data and refresh the grid's data from a specific user action, for example a button click, you must also call GridRefresh:

Procedure OnClick
    Send GridRefresh of oWebResultsGrid

Special attention is needed when populating a column whose peDataType is typeNumber, typeDate or typeDateTime, to ensure the values are sent to the client in a standard format. This is performed by applying the ConvertToClient function to each value. For example...

Move (ConvertToClient(typeDate, dMyDate)) to aRows[x].aValues[y]

Refer to the Sample section in cWebList for further examples demonstrating how to manually populate a grid.

Note that the parameter order of AddButton is slightly differrent than that of OnManualLoadData.