attrs - Attribute List
Adds attributes to a control. Use this property only where attributes are not available as properties.
Category
basicsSyntax
<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 setname
and value
.Attribute | Description |
---|---|
|
Creates the attribute when the page is loaded (default) or not. |
|
Minimizes the attribute in the HTML, rendering only the name and not the value, or not (default). |
|
The name of a valid HTML attribute. |
|
Renders (default) or does not render the attribute. |
|
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. |
|
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 useattrs
for
attributes that can be generated through the specification of control
properties.Examples
This Edit Box adds theautofocus
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>