<rethrow>

Extension. Causes the event currently being handled to be rethrown.

Syntax

 <rethrow />

Description

When executed within an event handler, this tag causes the event currently being handled to be rethrown. The execution environment searches for a new handler for the event starting in the scope above the one containing the current handler.

Rethrowing an event allows you to handle the same event at different levels. For example, an event handler in a form could perform a certain amount of cleanup and then rethrow the event so that a document-level event handler could perform further cleanup. For more information, see Chapter  3, Event Handling.

Usage

Parents Children
<bevocal:foreach>
<block>
<catch>
<error>
<filled>
<help>
<if>
<noinput>
<nomatch>

None.

See Also

 •  Related tags: <catch>, <error>, <help>, <noinput>, <nomatch>, <throw>

Examples

See other catch and throw examples under <throw> and <catch>.

 <?xml version="1.0" ?>
 <!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"
  "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
 
 <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
 
   <catch event="myEvent">
     <prompt>Catch of my event at document scope.</prompt>
     <goto next="#nonumbers" />
   </catch>
 
   <form id="numbers">
     <catch event="myEvent">
       <prompt>
         Catch of my event at form scope.
         This will test the rethrow tag.
       </prompt>
       <rethrow/>
     </catch>
     <block name="numbergame"> This is a test of the throw tag. </block>
     <field name="mynumber" type="number">
       <prompt> 
         Tell me a number greater than ten.
       </prompt>
       <filled>
         <prompt>
           The number you said is <value expr="mynumber"/> 
         </prompt>
         <if cond="mynumber &lt; 10">
           <throw event="myEvent"/>
         </if>
       </filled>
     </field>
   </form>
 
   <form id="nonumbers">
     <block>You will hear no numbers here. Goodbye.</block>
   </form>
 </vxml>

[Show Frames]   [FIRST] [PREVIOUS] [NEXT]
BeVocal, Inc. Café Home | Developer Agreement | Privacy Policy | Site Map | Terms & Conditions
Part No. 520-0001-02 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL