value - Value (control and data binding)

Binds a control to a data element or other value.

Category

data

Syntax

value="#{object.node1.moreNodesAsNeeded}"
value="${object.node1.moreNodesAsNeeded}"
<xp:this.value><![CDATA[#{javascript:textOfScript}]]></xp:this.value>
<xp:this.value><![CDATA[${javascript:textOfScript}]]></xp:this.value>
Where object is the name of a global object representing a data source, for example, document1 or view1, or the name of a scoped variable. Follow the object name with one or more node names to drill down to an element of data. And where textOfScript is Javascript that returns a value.

Usage

In Design mode, click the Data or Value tab under Properties and look under Bind data using, or click All Properties and look for value under data.
The general form of the XML is either:
  • An Expression Language statement enclosed in curly brackets preceded by a pound sign to compute dynamically or a dollar sign to compute on page load.
  • A CDATA section containing a JavaScript™ segment enclosed in curly brackets preceded by a pound sign to compute dynamically or a dollar sign to compute on page load.

For a discussion of data binding, see Binding and submitting data.

Examples

This edit box is bound to the subject field of the Domino document identified as document1.
<xp:inputText id="inputText1" value="#{document1.subject}"></xp:inputText>
This edit box is bound to the subject field of the Domino view identified as document1.
<xp:inputText id="inputText1" value="#{view1.subject}"></xp:inputText>
This edit box is bound to the sessionScope variable named scoped1.
<xp:inputText id="inputText1" value="#{sessionScope.scoped1}"></xp:inputText>
This edit box is bound to the component parameter named Parameter1.
<xp:inputText id="inputText1" value="#{componentParameters.Parameter1}"></xp:inputText>
This edit box is bound to the return value of a script. This might also be specified as a custom data. For JavaScript, you specify only the script. For custom, you specify ${javascript:text_of_script}.
<xp:inputText id="inputText1" value="#{document1.subject}"><xp:this.value><![CDATA[${javascript:document1.getItemValueString("subject")}]]&gt;</xp:this.value></xp:inputText>