ItemTemplate Tag

Purpose

The GEN:ItemTemplate tag creates a repeating layout within a GEN:Table code generation tag for displaying rows in a table.  The contents of the ItemTemplate tag are repeated at run time for each record retrieved from the database table.  If you specify a SeparatorTemplate, then its contents are added after each record.  If you specify an AlternatingItemTemplate, then the contents of the ItemTemplate and the AlternatingItemTemplate are alternated.  This is useful to show an alternating layout in the table.

The ItemTemplate tag can be placed anywhere within a Table code generation tag and may contain other code generation tags, including another Table code generation tag and another ItemTemplate tag to specify a table inside a table.

If no ItemTemplate tag is present, then no records from the database will be displayed.  In general, there is only one ItemTemplate tag present within a Table code generation tag.  If multiple ItemTemplate tags are used, the generated controls will repeat over the same set of records multiple times, one for each of the ItemTemplate tags.  There are no limitations on the number of ItemTemplate tags used within a Table code generation tag.

Used In

HTML Layout Pages and Page Templates.

The ItemTemplate tag can only be specified within a Table tag.

Code Generation Tag Attributes

None.  The ItemTemplate tag does not require a Name attribute.

Examples

     <GEN:Table Name=”EmployeesTable”>

              <!-- table header and header row -->
              <table>
                 <tr><td colspan=10>Header Row</td></tr>
                 <!-- repeating row template -->
                 <GEN:ItemTemplate>
                   <tr>
                    <td><GEN:FieldValue Name=”FirstName”/></td>
                    <td><GEN:FieldValue Name=”LastName”/></td>
                    <td><GEN:FieldValue Name=”Title”/></td>
                    <td><GEN:FieldValue Name=”Address”/></td>
                    <td><GEN:FieldValue Name=”City”/></td>
                    <td><GEN:FieldValue Name=”State”/></td>
                    <td><GEN:FieldValue Name=”ZipCode”/></td>
                    <td><GEN:FieldValue Name=”Country”/></td>
                    <td><GEN:FieldValue Name=”Phone”/></td>
                   </tr>

                </GEN:ItemTemplate>             

                <!-- table footer -->
                <tr><td colspan=10>Table Footer Row</td></tr>

             </table>
     </GEN:Table>