To display a list of all the matching records from a Search command or a [Search] context, put a [FoundItems] context into a WebDNA template. If the search specified a maximum number of matches, then only that many will be displayed in the [FoundItems] loop. To display the result of many searches on a single page, you may put the [FoundItems] context inside an embedded [Search] context. Also see [ShowNext].
Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):
You also use the [FoundItems] within a [SQL] context, to list the records resulting from a successfull ODBC/SQL query.
The [FoundItems] context is also used within a [SQLResult] context, to list the records resulting from a successfull Native SQL query.
When used within [SQLResult], the new 'Iterate' parameter can be specified to control the behavior of the [FoundItems] context.
In setting the 'iterate' parameter to 'manual', the [FoundItems] context behaves more like a collection. The WebDNA programmer can retrieve the found records in any manner they wish.
Parameter | Description |
---|---|
Only available within [SQLResult] |
(Optional) - Manual/Auto - When set to MANUAL, the [FoundItems] context switches to 'manual' mode. The new [Seek] tag must then be used to 'move' the record set cursor. The cursor is always initialized to the first record position. When set to Auto - [FoundItems] reverts to default behavior, iterating the record set one record at a time, starting from the first item, and ending with the last item. |
The following tags are available inside a [FoundItems] context:
Tag | Description | ||||||
---|---|---|---|---|---|---|---|
[FieldName]
|
Name of any field in the database being searched. | ||||||
[Index]
|
A number from 1 to the maximum number of matching records indicating this record's index placement in the list. | ||||||
The following tags are only valid when [FoundItems] is used with a [SQLResult] context. | |||||||
|
The [field] tag is used within [FoundItems] to return information about a particular field of the current record.
Parameters:
get (optional) - The get parameter accepts one of seven possible enumerated values: raw (optional) - When retrieving field data where the field data type is: DATE, TIME, or DATETIME , WebDNA will 'interpret' the data based on the user defined WebDNA preferences for displaying Dates and Times. However, if you wish to display the data in its 'raw' format, you can set the 'raw' parameter to 'T'.
For example:
|
||||||
|
When the 'iterate' parameter for [FoundItems] is set to 'manual'. The [Seek] tag is used to position the result set 'cursor' to a particular record.
Parameters: Example:
|