Skip to main content
Version: ILLiad 10.0 (Pre-release) 🚧

DATAREPEATER and DATAROW Tags

The DATAREPEATER tag renders a template file once for every row of data. The DATAROW tag goes inside that template file and is replaced with a value from the row being rendered. Together they build the request lists on the default web pages as div elements, rather than as fixed HTML tables.

The two tags are always used as a pair. A DATAROW tag has no meaning outside a repeater's template file.

<#DATAREPEATER>

Renders a template file once for each row of data. The customizations are made in the tag itself and cannot be changed from the web interface.

AttributeValueDescription
nameName of the repeaterWhich set of data to iterate over. Required. See the lists below.
TemplateFile"<Path/To/File>"Relative path to the template file used to format each row. Required.
noDataActionAny stringText displayed in place of the list when there is no data
orderby"<columnName> [ASC|DESC]"Column used to order the data

A repeater as it appears in the default ViewAllRequests.html:

<#DATAREPEATER name="ViewAllRequests" TemplateFile="templates/DataRow_DefaultRequest.html" noDataAction="You have no requests" orderby="TransactionNumber DESC">

The <#DATAREPEATER> tag produces the whole list. The template file it names describes a single entry, and the DLL renders that file once for every row of data. Inside the template file, each <#DATAROW> tag is replaced with one field value — a title, an author, a transaction number — so one entry usually contains several of them.

In the Checked Out Items list below, the outlined block is what the repeater produced. Each entry inside it is one render of DataRow_CheckedOutItems.html, and every value shown in that entry comes from a separate <#DATAROW> tag:

Checked Out Items list on the ILLiad main menu, with the block produced by the DATAREPEATER tag outlined around its two entries

note

noDataAction does not work the same way here as it does on a TABLE tag. On a DATAREPEATER it holds the message text itself, and there is no noDataMessage attribute. On a TABLE tag it takes one of a set of values — ShowMessageRow, ShowEmptyTable, or ShowNone — and the message text goes in noDataMessage.

If name is left out, or TemplateFile is left out or points at a file that isn't there, the repeater produces nothing at all and records the reason in the web log.

Repeaters available in the Borrowing web DLL

ViewAllRequestsNotesInformation
ViewSearchResultsTrackingInformation
ViewOutstandingRequestsBillingInformation
ViewRequestHistoryElectronicDelivery
ShowCurrentAccountsElectronicDeliveryUndelete
ViewRenewCheckedOutItemsViewEmailNotifications
ViewResubmitCancelledItemsViewSMSNotifications
HistoryInformationNotificationInformation

Repeaters available in the Lending web DLL

BillingInformationViewOutstandingLendingRequests
HistoryInformationViewLendingRequestHistory
NotesInformationViewSearchResults
NotificationInformationViewShippedItems
TrackingInformationViewLendingCancelledItems
ViewAllRequestsViewNotifications

A repeater and a TABLE tag draw on the same named sets of data, so most names work with either tag. There are exceptions. DetailedInformation is available to TABLE tags only, in both web DLLs. In the Borrowing web DLL, the deprecated ViewNotifications is also available to TABLE tags only.

<#DATAROW>

Used inside a repeater's template file. Each tag is replaced with a value from the row currently being rendered.

Attributes

AttributeDescription
fieldThe name of the row element to insert
displayStyleHow to format the replacement text, or which conditional behavior to apply
nameUsed with field='RequestActionAllowed' to name the action being tested
enabledValueString inserted when the action is allowed
disabledValueString inserted when the action is not allowed

Field values

Some field values are reserved words that trigger specialized behavior:

  • FileSize — the default is a human-readable size such as 203.99 KB. Setting displayStyle='Bytes' gives the raw figure instead, such as 208885.

    <#DATAROW field='FileSize'>
    <#DATAROW field='FileSize' displayStyle='Bytes'>
  • Title — for a loan, LoanTitle. For an article, the title field in the database matching the document type, such as PhotoJournalTitle.

  • Author — for a loan, LoanAuthor. For an article, the author field matching the document type.

  • TransactionStatus — the display status.

  • RequestActionAllowed — substitutes a value depending on whether an action is available for that request. See below.

Formatting styles

StyleResult
ISO8601Formats a date to the ISO 8601 standard, YYYY-MM-DD
CurrencyFormats a numeric field to the USD standard
PercentageFormats a decimal value as a percentage

Using both the formatted and the raw date, so the page can convert to local time:

<span class="convert-local" data-iso8601="<#DATAROW field="CreationDate" display="ISO8601">"><#DATAROW field="CreationDate"></span>

Conditional display

A DATAROW tag accepts the same displayStyle='CompareValue' and displayStyle='CheckHasValue' behaviors as a TRANSACTION tag, applied to the row being rendered rather than to a single request. For a fuller treatment of the pattern, including multiple conditions and troubleshooting, see Transaction Conditional Display.

Enabling and disabling request actions

RequestActionAllowed tests whether an action applies to the current request, then inserts one string or the other. It's how the default pages decide which CSS classes land on a request's action buttons, and it's the way to build a custom actions menu — the role <#MENU> tags filled in older sets of web pages.

AttributeValueDescription
fieldRequestActionAllowedSelects this behavior
nameAn action nameThe action to test for this request
disabledValueUsually disabledInserted when the action isn't available
enabledValueAny stringInserted when the action is available

Action names in the Borrowing web DLL: Edit, Cancel, Renew, Resubmit, Clone, ViewPDF, DeletePDF, UndeletePDF

Action names in the Lending web DLL: Edit, Cancel, Renew, Resubmit, Clone

From the default DataRow_DefaultRequest.html, the View PDF menu item:

<a class="dropdown-item btn btn-light menuViewPdf <#DATAROW field='RequestActionAllowed' name='ViewPDF' disabledValue='disabled'>" href="<#ACTION action='10' form='75'>&amp;Value=<#DATAROW field='TransactionNumber'>">View PDF</a>

When there is no file to view, disabled is added to the class list and the option isn't offered. When a file exists, nothing is substituted and the button works normally.