Partager via


LabelText and Text XML Elements Reference

You can add a standalone label or informational text to a work item form by using the LabelText element. The label is not associated with any work item field. Optionally, you can add a hyperlink to some or all of the text.

To add elements to a form, you modify a work item type. See Modify or add a custom work item type (WIT).

The LabelText element is a child element of the Control element.

Schema Hierarchy

WITD

   WORKITEMTYPE

       FORM

           Layout

               Group

               Column

               TabGroup

                  Tab

                     Control

<LabelText>
   <Text>
      <Link OpenInNewWindow="true | false" UrlPath="URLLinkWithParameters">
         <Param index="IndexValue " value="ParamValue " type ="Original | Current"/>
      </Link>
      LabelText
   </Text>
</LabelText>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Child Elements and Attributes

Element

Description

LabelText

Required Control element when type="LabelControl".

Container element for a standalone label or informational text. The element type is complex type: LabelElementType.

This element overwrites the value specified by the Label attribute specified by the Control element.

Text

Required LabelText element.

Container element for the information or label to appear on the work item form. If the Link element is specified within the label, the portion of the text within the element is hyperlinked. If the Link element is not specified, the text is rendered without a hyperlink.

Different parts of the label text can be hyperlinked with different URLs. Multiple text element values can be specified in a series.

The element type is complex type: TextElementType.

If the Text element is not specified, then the Control element Label attribute text appears on the work item form.

Link

Optional Text element.

Container element for the hyperlink to be applied to a field or standalone label that appears on the work item form. The element type is HyperLinkType.

Note

You must specify the Label attribute in a Control element when you specify a child Link element.

For more information, see Link and Param XML Elements Reference.

Parent Elements

Element

Description

Control

Required. Defines a field, text, hyperlink, or other control element to appear on the work item form.

Remarks

You can combine plain and hyperlinked text by adding multiple Textelements in a LabelText element.

The LabelText element is only recognized by clients that are running the latest version of Team Explorer. Therefore, you must specify the Label attribute in a Control element. For clients that are running the latest version of Team Explorer, the text provided by the LabelText element appears in the work item form. For clients that are running earlier versions of Team Explorer, the text specified by the Control element Label attribute appears in the work item form.

Example: Standalone Label

Description

The following example adds the plain text "Enter details about how to reproduce the bug in the space below:" to a work item form.

Code

<Control Type="LabelControl" Label=" Enter details about how to reproduce the bug in the space below:">
   <LabelText>
      <Text>Enter details about how to reproduce the bug in the space below:
      </Text>
   </LabelText>
</Control>

Description

The following example adds a hyperlink which is labeled "How do I use this work item?" to a work item form.

Code

<Control Type="LabelControl" Label="How do I use this work item?">
   <LabelText>
      <Text>
   <Link UrlRoot="http://www.live.com"></Link>
      How do I use this work item?
      </Text>
   </LabelText>
</Control>

Description

The following example adds a two-part label to a work item form. The first part, "Iteration Path", is associated with a hyperlink. The second part, "(must be 3 levels deep)" appears on the work item form as plain text.

Code

<Control Type="FieldControl" FieldName="System.IterationPath" LabelPosition="Left">
   <LabelText>
      <Text>
         <Link UrlRoot="@WssSiteUrl/render.aspx?wit=bug&amp;topic=Iteration">
         </Link>
      Iteration Path
      </Text>
      <Text> (must be 3 levels deep)</Text>
   </LabelText>
</Control>

Schema Definitions

Element: LabelText

<xs:element name="LabelText" type="LabelElementType" minOccurs="0" maxOccurs="1" />
<xs:element name="Text" type="TextElementType" minOccurs="1" maxOccurs="unbounded" />

Complex Type: LabelElementType

<xs:complexType name="LabelElementType">
   <xs:sequence>
      <xs:element name="Text" type="TextElementType" minOccurs="1" maxOccurs="unbounded" />
   </xs:sequence>
</xs:complexType>

Complex Type: TextElementType

<xs:complexType name="TextElementType" mixed="true">
   <xs:sequence>
      <xs:element name="Link" type="HyperLinkType" minOccurs="0" maxOccurs="1" />
   </xs:sequence>
</xs:complexType>

See Also

Concepts

Specify work item form controls