SetList Element

The SetList element renders no output, but designates which list is current. Once a list is set, a View element can be used to render views on the list.

Syntax

<SetList
  Name = "Text"
  PreserveContext = "TRUE" | "FALSE"
  Scope = "Request">
</SetList>

Attributes

Name Description
Name Required Text. Specifies the name of the list.
PreserveContext Optional Boolean. If FALSE, then implementing the SetList element reruns the database query that is necessary to fetch the data for a form that displays a single list item. This functionality is useful when a view and a form are on the same page. The default value is TRUE.
Scope When set to Request, this attribute makes the list globally available to the page.
Parent Elements Child Elements
Case, Expr1, XML GetVar

Remarks

When you use the SetList element, you need to use the internal name, which has no spaces and is invariant.

The SetList element has both a spanning and a non-spanning form, so that <SetList>Announcements</SetList> would be the same as <SetList Name="Announcements"/>.

Example

The following example returns the value of the Title field from the List of Lists table if the current list equals the Lookup list. The current list is first temporarily assigned to a variable, Old, and then reinstated as the current list.

<ows:XML>
  <SetVar Scope="Request" Name="Old"><List/></SetVar>
  <SetList><GetVar Name="Lookup"/></SetList>
  <IfEqual>
    <Expr1><List/></Expr1>
    <Expr2><GetVar Name="Lookup"/></Expr2>
    <Then>
      <ListProperty HTMLEncode="TRUE" Select="Title"/>
    </Then>
  </IfEqual>
  <SetList><GetVar Name="Old"/></SetList>
</ows:XML>

See Also

List