attrs - Attribute List

Adds attributes to a control. Use this property only where attributes are not available as properties.

Category

basics

Syntax

<xp:this.attrs>
	<xp:attr attributename="attributevalue" ...</xp:attr>
	...
</xp:this.attrs>

Usage

In Design mode, click All Properties and look for attrs under basics.

Attributes

You should minimally set name and value.
Table 1. Attributes
Attribute Description
loaded="true|false"
Creates the attribute when the page is loaded (default) or not.
minimized="true|false"
Minimizes the attribute in the HTML, rendering only the name and not the value, or not (default).
name="name"
The name of a valid HTML attribute.
rendered="true|false"
Renders (default) or does not render the attribute.
uri="true|false"
Treats value as a URI or not (default). A URI value without a protocol (for example, http://) is relative to the current application. URL encoding is in effect so use %20 for a space.
value="value"
The value of the attribute. Not rendered if minimized is true.

Usage

This property permits the inclusion of an HTML attribute for which no control property exists. Do not use attrs for attributes that can be generated through the specification of control properties.

Examples

This Edit Box adds the autofocus attribute without rendering its value.
<xp:inputText id="inputText3">
	<xp:this.attrs>
		<xp:attr name="autofocus" value="autofocus" minimized="true"></xp:attr>
	</xp:this.attrs>
</xp:inputText>
This Edit Box of type email adds the placeholder attribute.
<xp:inputText id="inputText3" type="email">
	<xp:this.attrs>
		<xp:attr name="placeholder" value="a@b.com"></xp:attr>
	</xp:this.attrs>
</xp:inputText>