<throw>
Throws an event within an application.
Attributes
This section describes the attributes you can set for this element.
|
Name |
Data type |
Default |
|---|---|---|
|
NMTOKEN |
Optional |
|
|
CDATA |
Optional |
|
|
CDATA |
Optional |
|
|
CDATA |
Optional |
event
The event attribute specifies an event name.
Note: You can invent an event name. If you invent an event name, make sure you supply a <catch> element with a corresponding event name to handle the event. The event name is available in the <catch> element where the event is caught as _event.
eventexpr
The eventexpr attribute specifies an ECMAScript expression that resolves to the name of the event to be thrown.
message
The message attribute specifies a message describing the event being thrown. This message is available in the <catch> element where the event is caught as _message.
messageexpr
The messageexpr attribute specifies an ECMAScript expression that resolves to the message describing the event being thrown.
Children
None.
Parents
Sample code
<form id="monty_python_holy_grail">
<field name="your_name">
<prompt>What is your name?</prompt>
<grammar><item repeat=”0-1”>I am</item><item>king arthur</item></grammar>
<help>
<prompt>hint: you are the king.</prompt>
<reprompt/>
</help>
</field>
<field name="swallow">
<prompt>What is the average wind speed velocity of an unladen
swallow?</prompt>
<grammar><item>african or european</item></grammar>
<catch event="help">
<prompt>hint: it depends where the bird comes from.</prompt>
<reprompt/>
</catch>
</field>
<noinput>
<prompt>sorry, i didn't catch that.</prompt>
<reprompt/>
</noinput>
<nomatch>
<prompt>no, sorry, that's not it. try again.</prompt>
</nomatch>
<error>
<log expr="'Error processing bridge sequence. and now for something completely different.../>
<throw event="SOMETHING_COMPLETELY_DIFFERENT"/>
</error>
<filled>You may pass.</filled>
</form>