Export (0) Print
Expand All

Field Rendering Elements

SharePoint Team Services 1.1

CAML has two major types of elements — those for page rendering and those for field rendering and schema definition. The CAML field rendering elements are designed for use when rendering individual field values. These can appear in field definitions, or more commonly, in FLDTYPES.XML (Program Files\Common Files\Microsoft Shared\web server extensions\50\Templates\1033\xml\).

A field is basically a column or an attribute of information that a user can add to a list. Each list on a Web site based on SharePoint Team Services from Microsoft has metadata stored in the List of Lists table in the database. The format of the schema is an XML structure, such as follows:

<Fields>
  <Field Type="Counter" Name="ID"/>
  . . . other field definitions. . .
</Fields>

In order to simplify the implementation of the various field types, and to allow for a higher degree of flexibility in rendering the various fields, FLDTYPES.XML contains information about the rendering and behavior of each field type. The Field element renders different HTML depending on the data type of the field in question, and FLDTYPES.XML defines the data types and render patterns for each kind of field. The following table presents the schema used in this file.

NameData TypeDescription
Column2SuffixTextText to append to base column name to derive ColumnName2 from ColumnName (for two-column fields like URL).
DisplayPatternNoteContains the HTML template for rendering the field in the display mode of a view or of a form. Typically, the value is <ows:FieldRef/>, but for a Lookup field the value is <A HREF="<ows:LookupHREF/>"><ows:LookupTitle/></A>.
EditPatternNoteContains the HTML template for generating the Edit form control to edit the field. Typically, this value is <INPUT NAME="<ows:FieldName/>" VALUE="<ows:FieldRef/>">.
HeaderPatternNoteContains the HTML template for displaying the heading of a table view column. Typically, the value is <ows:DisplayName/>.
InternalTypeTextDetermines the behavior of the Column element in rendering data from the database and how data is posted back to the database. Can be one of the following values: Text, Note, Number, Currency, Integer, Boolean, DateTime, Threading, Lookup, Choice, URL, Counter, or DisplayOnly. Note that a DisplayOnly field type has no storage of its own.
NameTextThe field contains the name of the internal data type as referenced in a Type attribute of the Field element: <Field Type=”Name”/>. Examples are Text, Note, Number, etc.
NewPatternNoteContains the HTML template for generating the New Form control for editing the initial value of a field. Typically the value will be <INPUT NAME="<ows:FieldName/>" VALUE="<ows:DefaultValue/>">.
PreviewDisplayPatternNoteThis is how fields are rendered when a display form is being edited in Microsoft FrontPage.
PreviewEditPatternNoteThis is how fields are rendered when an edit form is being edited in Microsoft FrontPage.
PreviewNewPatternNoteThis is how fields are rendered when a new form is being edited in Microsoft FrontPage.
SortableTextSpecifies whether a field can be sorted. Can be TRUE or FALSE.
TypeNameTextSpecifies a name in the definition of a field type.
SQLTypeTextThe underlying SQL data type for the given field. Examples are nvarchar(255), memo, integer, float. Used to generate the appropriate SQL (CREATE TABLE) for creation of a field of this type.
SQLType2TextWhen not blank, gives the type of a secondary column to create for the current field (see URL field type, for example).

Each of the display modes (Display, Edit, New, etc. ) contains a definition for how to render each of the field data types that are supported by SharePoint Team Services.

For each display mode there is a display pattern, or CAML rendering expression. Some CAML elements are used specifically in display patterns. Others can be used in either context (in other words, for page rendering or for field rendering), but are used primarily in rendering fields. The following intrinsic CAML rendering elements are used to build templates that can include both static HTML and data, as well as metadata of the field being rendered.

ElementDescription
ColumnReturns the "raw" data value for a particular field.
Column2Used in rendering a Link field type.
EscapeUsed to escape certain characters in strings.
FieldFilterOptionsUsed in the HeaderPattern sections of FLDTYPES.XML to display filter drop-down menus.
FieldPrefixReturns the Microsoft Office namespace, “urn:schemas-microsoft-com:office:office#”.
FieldRefUsed in computed fields to refer to the constituent fields and in views to define what fields are present.
FieldSortImageURLReturns the URL to the image file used to indicate how a column is sorted.
FieldSortParamsReturns the sort direction on a list, rendering Asc or Desc based on whether the field has been sorted and the current default sort direction for the field.
IfEqualAllows for conditional rendering based on the comparison of two CAML expressions.
IfNewReturns TRUE if the item is considered new.
ImagesPathReturns the HTTP path to the images directory for the project.
LimitTruncates text to a specified size.
LocaleInfoTransfers server locale information to the client in order to display and edit dates and numbers properly.
PageURLUsed anywhere to return the absolute, encoded URL of the current page.
PropertyReturns the property from the current ForEach context.
ScriptQuoteUsed for rendering text from the server that must be interpreted as a quoted string.
TodayISORenders today’s date and time in ISO format.

See Also

Introduction — What Is CAML?

Page Rendering Elements


Show:
© 2014 Microsoft