LookupColumn Element

The LookupColumn element functions similarly to the Column element, and it is only valid when referring to a lookup field. The sole distinction between Column and LookupColumn for lookup fields is that LookupColumn retrieves the raw value of the column from the foreign list, while Column retrieves the raw value of the column in the local list.

Syntax

<LookupColumn
  HTMLEncode = "TRUE" | "FALSE"
  Name = "Text"
  StripWS = "TRUE" | "FALSE"
  URLEncode = "TRUE" | "FALSE"
  URLEncodeAsURL = "TRUE" | "FALSE">
</LookupColumn>

Attributes

Name Description
HTMLEncode Optional Boolean. Converts embedded characters so that they are displayed as text in the browser. In other words, characters that could be confused with HTML tags are converted to entities.
Name Required Text. Specifies the name of the lookup column. Allows the LookupColumn element to be used outside the field rendering context by supplying an ID.
StripWS Optional Boolean. TRUE if white space is removed from the beginning and end of the value returned by the LookupColumn element.
URLEncode Optional Boolean. When TRUE, converts special characters, such as spaces, to quoted UTF-8 format (for example, %c3%ab for character ).
URLEncodeAsURL Optional Boolean. Like URLEncode, but TRUE if what is being encoded is a path component of a URL.
Parent Elements
Case, Default, DisplayPattern, Expr, GetFileExtension, GetProgID, RenderPattern, ScriptQuote, UrlBaseName, ViewBody

Remarks

In the typical case of a lookup field called LookupTitle that points to the title of item 1 in the announcements list, <LookupColumn Name="LookupTitle"/> would render "Welcome to your new team Web site!", while <Column Name="LookupTitle"/> would render "1". Consequently, in most situations using lookup fields, you want to use LookupColumn instead of Column. The only time to use the Column element is when you need a raw reference to the ID of the item in the target list, perhaps for constructing your own link to the target item.

Example

The following example uses the LookupColumn element to return a value that is used in creating a complete URL to a page on the server.

<HTML>
  <![CDATA[ <a href="  ]]>
</HTML>
<HttpHost URLEncodeAsURL="TRUE" />
<LookupColumn URLEncodeAsURL="TRUE" />
<HTML>
  <![CDATA[ ">  ]]>
</HTML>

See Also

Universal Attributes for Page Rendering Elements

Column Element