DataSource built-in tag

Usage:
<DataSource Name=value>

Name

The name of the recordset on which the datasource is based.

Extra properties

Some components need to be able to run a set of sub-components. For example, the SYS_Flow_Test tag needs a collection of components that are run when the test is passed. This is done by nesting the components inside the <SYS_Flow_Test> tag, inside a <Collection Name="True"> tag. The only property that a Collection tag has is a name. In the case of SYS_Flow_Test this can take the name of "True" or "False".

The DataSource tag allows a slightly more complex use of sub-components. By specifying a set of components inside a <Collection Name="OnRowChange"> tag within a datasource, we can cause the components to be run each time a new row of the recordset is processed. This is slightly difficult to grasp, so an example and explanation are shown below.

<DataSource Name="rstDateList">
  <SYS_Recordset_GetWhere >
    <Property Name="SelectUsing">
      <Property><Properties FieldName="StartDate" 
                  Value="{Date.Now}" Op="gt"/></Property>
    </Property>
  </SYS_Recordset_GetWhere >

  <Collection Name="OnRowChange">
    <SYS_Recordset_GetWhere RecordsetName="rstCourseSummary" >
      <Property Name="SelectUsing">
        <Property><Properties FieldName="StartDate" 
                    Value="{rstDateList.StartDate}"/></Property>
      </Property>
    </SYS_Recordset_GetWhere>
  </Collection>
</DataSource>

One of the views in a booking system is a calendar view of future courses. Each date could have none, one or many courses. First we populate a recordset rstDateList with every date that has been entered (which therefore must have at least one course on it, otherwise it wouldn't have been entered). This is the first GetWhere statement shown above.

Then, for each date in that recordset we collect a list of all the courses that are on that date. This is executed at display time, when Arcos displays a date and a list of courses on that date, and then moves to the next date.

In the second GetWhere statement, inside the OnRowChange tag, we extract courses using StartDate={rstDateList.StartDate}, where the curly bracket expression will return the start date of the current row of the rstDateList recordset.