Set Value (Simple actions)

Sets the value of a computed expression.

Defined in

Simple actions

Type of simple action

Basic (Server)

Syntax

Note: This is the XSP source code. The UI presents the simple action as a dialog with a box for each argument.
setValue binding=javax.faces.el.ValueBinding object value="generic"
Arguments Description UI presentation
binding Points to the data whose value is being set. An edit box plus the diamond icon. Double-click the field or click the diamond to dynamically compute the value.
value Value to be set. An edit box plus the diamond icon. You can type a value in the field or click the diamond to dynamically compute the value.

Usage

The expression cannot be for a read-only object.

Examples

Note: These examples present XSP source code which can be inserted under the Source tab taking care to keep the XML well formed. To use the UI, select or enter the arguments in the simple action dialog.
This button sets the value green for the [computed expression].
<xp:button value="Set Value" id="button1" style="width:142.0px">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
	<xp:setValue binding=[ce] value="green"></xp:setValue>
</xp:this.action></xp:eventHandler></xp:button>