xforms:textareaAdded by IBM on October 10, 2012 | Version 1 (Original)
|Links a multi-line field to an element in the data model so that they share data. For example, if you added an xforms:textarea option to a field in your form, you could use that option to link the field to an element in your data model. Once linked, any changes made to the data in one would be reflected by the other.
This option is only available if you are using an XForms data model.
Table 1. xforms text area parameters
|single node binding||string||see Single node binding.|
|label text||string||sets the text for the field's built-in label, as well as the accessibility message for the field. Leave this setting empty for no label.
If the item also has a label or acclabel option, they will override this setting.|
|Alert, Hint, Help Setting||metadata||see Metadata sub-options.|
Available in custom, field
Example The following code shows an XForms model that contains a to, from, date, and note element:
Using that data model, the following code links a field to the note element in the data model, so that they share data:
- This option is for multi-line fields. To create a field with only a single line of input, use the xforms:input option instead.
- If an XFDL field has a texttype setting of text/rtf, then the UI binding connects to the rtf option rather than the value option for that field.
- To copy the plain text from an rich text field to the XForms data model, you must use a custom item with an xforms:textarea. Within that item, create a custom option that has a compute. This compute must copy the contents of the value option from the rich text field to the value option for the custom item. For example:
<value>contains the plain text</value>
<custom:copytext compute="toggle(commentField.value) == 1 ?
set(value, commentField.value) : ''"/>
<value>is set to contain the plain text</value>
- Any item with an xforms:textarea option can trigger XForms actions using the xforms-value-changed event. For more information, refer to XForms event handlers.
- When you add an xforms:textarea to a custom item, it works just as though it was placed in a valid XFDL item. This means that a value option is created and is linked to the data model.