Plands.com Logo  Business Internet Services 
Main Menu
Home
Planetary CRM
  Benefits
  Features
  Demo
E-Mail Services
  E-mail Hosting
  Newsletters
  Discussion Lists
Web Hosting
Server Co-location
and Administration
Web Applications
Technical Support
Contact Us
DXP Samples
 
DxpHome  ||   Samples  ||   Details  ||   Docs  ||   Trees  ||   xml-xsl  ||   Links
// LoopSet.java

The LoopSet is used to iterate through a set of records that are stored in a String[][] and insert data from row columns into a template defined in the LoopSet. This is normally used to insert a number of database records into a display template. In the template, Index tags define data columns to insert.

<table>
   <tr>
      <th>First</th><th>Last</th>th>Phone</th>
   </tr>
   <dxp:LoopSet matrix="queryResult">
   <tr>
      <td><dxp:Index>0</dxp:Index></td>
      <td><dxp:Index>1</dxp:Index></td>
      <td><dxp:Index>2</dxp:Index></td>
   </tr>
   </dxp:LoopSet>
</table>

Some applications will use an XSL stylesheet to control the output format and others may require data to be structured inside custom tags. Here is a hypothetical example using custom tags to structure the output:

<contacts>
<dxp:LoopSet matrix="queryResult">
   <person>
      <firstname><dxp:Index>0</dxp:Index></firstname>
      <lastname><dxp:Index>1</dxp:Index></lastname>
      <phone><dxp:Index>2</dxp:Index></phone>
   </person>
</dxp:LoopSet>
</contacts>

Other active tags can be included in the LoopSet but they must not enclose
<dxp:Index> and <dxp:RowNum> tags. The tags enclosing them in the previous examples are not active tags with the exception of LoopSet which is permitted.

The rows attribute can be used to specify which groups of rows to print. See the method printRowSpec() below for information on to use this.
@see com.plands.dxp.RecordSet which prodcues this rows Object.

<table>
   <tr>
      <th>First</th><th>Last</th>th>Phone</th>
   </tr>
   <dxp:LoopSet matrix="queryResult" rows="rowsToPrint">
   <tr>
      <td><dxp:Index>0</dxp:Index></td>
      <td><dxp:Index>1</dxp:Index></td>
      <td><dxp:Index>2</dxp:Index></td>
   </tr>
   </dxp:LoopSet>
</table>


@author Mark Ashworth
@version 0.2, 2001-04-09

Return to Index

Note: We have tried to test all of the code examples but they may contain errors. Any questions, comments, suggestions, or problems should be sent to info@plands.com.