<subdialog>
<subdialog>
Subdialogs are a mechanism for reusing common dialogs and building libraries of reusable applications.
Attributes
Name | Data type | Description |
---|---|---|
name | String | The result returned from the subdialog, an ECMAScript object whose properties are the ones defined in the namelist attribute of the <return> element. |
cond | String | (defaults to true) An expression that must evaluate to true after conversion to Boolean in order for the event to be caught. |
expr | String | The initial value of the form item variable; default is ECMAScript undefined. If initialized to a value, then the form item will not be visited unless the form item variable is cleared. |
src | String | The URI of the subdialog. |
srcexpr | String | An ECMAScript expression yielding the URI of the subdialog. |
fetchhint | This attribute is not supported. | |
fetchtimeout | String | (defaults to “fetchtimeout” global property value) The timeout for fetches. Must be specified with the appropriate time units (e.g., “120s” for 120 seconds). |
maxage | String | (defaults to “documentmaxage” global property value) Tells the platform the maximum acceptable age, in seconds, of cached documents. |
maxstale | String | (defaults to “documentmaxstale” global property value) Tells the platform the maximum acceptable staleness, in seconds, of expired cached documents. |
fetchaudio | String | (defaults to “fetchaudio” global property value) The URI of the audio clip to play while the fetch is being done. |
method | String | (defaults to “get”) The request method: "get", "post", or "raw". |
enctype | String | (defaults to “application/x-www-form-urlencoded”) The media encoding type of the submitted document. Accepted values include the following:
|
rawexpr | String | The raw XML or JSON string to submit to the URI. You can only use this attribute when using the “raw” method and either the “application/xml” or “application/json” enctype. |
namelist | String | The list of variables to submit. The default is to submit no variables. If a namelist is supplied, it may contain individual variable references that are submitted with the same qualification used in the namelist. Declared VoiceXML and ECMAScript variables can be referenced. |
Notes
Exactly one of “src” and “srcexpr” must be specified.
When setting the “method” attribute to “post”, the platform does a normal POST with the variables passed in the namelist encoded as “application/x-www-form-urlencoded” or “multipart/form-data”. After encoding the namelist, the platform passes the data and tells the server that the data is encoded with whatever format it used to encode.
However, when setting the “method” attribute to “raw”, the “raw” type is still a POST request, but does two things to change the default behavior, allowing control over both the data and the encoding type reported to the server:
Rather than encoding the namelist to create the “data”, the platform instead executes the rawexpr javascript expression and uses the result for the data.
It passes the encoding that was provided in the “enctype” attribute as the encoding to the web server.
Example
The output of the above script would be:
Computer: Hello World.
Child Tags
<audio>, <catch>, <enumerate>, <error>, <filled>, <help>, <noinput>, <nomatch>, <param>, <prompt>, <property>, <value>
Parent Tags
Last updated