< throw >
Description
The <throw> element throws a pre-defined event or application-specific event.
Syntax
<throw event="event" eventexpr="ECMAScript_Expression" message="String" messageexpr="ECMAScript_Expression"/>
Attributes
| event | The event attribute defines the event name to throw. The attribute is required – specifically the event or eventexpr is required. |
| eventexpr | The eventexpr is an expression that yields the event name. The attribute is required – specifically the event or eventexpr is required. |
| message | The message attribute indicates a message string providing additional context about the event being thrown. For the pre-defined events thrown by the platform, the value of the message is platform dependent. The message will be available as a variable within the scope of the catch element. This attribute is optional. |
| messageexpr | The expression attribute defines the expression that yields the message. This attribute is optional. |
Parents
<block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Extensions
None.
Limitations/Restrictions
None.
Example Code
<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<catch event="goodbye">
<prompt>goodbye.</prompt>
<exit/>
</catch>
<form>
<field name="hello">
<grammar>hello | goodbye</grammar>
<help>Just say hello</prompt>
<prompt>Say hello</prompt>
<noinput>Say something</noinput>
<filled>
<if cond="hello == 'goodbye'>
<throw event="goodbye"/>
</if>
<prompt>Hello, world!</prompt>
</filled>
</field>
</form>
</vxml>