1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
|
<refentry id="vc_textarea">
<refmeta>
<refentrytitle>textarea</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>textarea</refname>
<refpurpose>Scriptable text-area input.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_textarea">
<funcprototype id="vc_proto_textarea">
<funcdef>
<<function>textarea</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>error-glyph</parameter> (optional) </attribute>
<attribute>
<parameter>auto-submit</parameter> (optional) </attribute>
<attribute>
<parameter>type</parameter> (optional) </attribute>
<attribute>
<parameter>default_value</parameter> (optional) </attribute>
<attribute>
<parameter>default</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_textarea">
<title>Description</title>
<para>Scriptable, databindable HTML text area.</para>
</refsect1>
<refsect1 id="vc_attrs_textarea">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>error-glyph</title>
<para>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</para>
</formalpara>
<formalpara>
<title>auto-submit</title>
<para>Flag to auto submit the parent form if value of the control is changed.</para>
</formalpara>
<formalpara>
<title>type</title>
<table>
<title>Allowed values of the 'type' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>plain</entry>
<entry>
<para>The value is displayed in a usual way and user can edit it. This is the default value.</para>
</entry>
</row>
<row>
<entry>password</entry>
<entry>
<para>The value is not shown on the screen to prevent occasional reading, only astericks are shown in the input field.</para>
</entry>
</row>
<row>
<entry>hidden</entry>
<entry>
<para>The text is passed to the target page without displaying it to the user.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>default_value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The default value of the field. Can be accessed via control.ufl_value n data bind stage.</para>
</formalpara>
<formalpara>
<title>default = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Deprecated alias of 'default_value'.</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_textarea">
<title>Declaration of type vspx_textarea</title>
<para>
</para>
<screen>
create type vspx_textarea under vspx_text temporary self as ref
constructor method vspx_textarea (name varchar, parent vspx_control),
overriding method vc_xrender () returns any,
overriding method vc_render () returns any
</screen>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/textarea.vspx">VX-S-2</ulink>
</para>
</tip>
</refentry>
|