BindOnChanged Property

  Microsoft Speech Technologies Homepage

Gets or sets whether the SemanticItem control binds to the target control when its value is changed or when it is confirmed. Read/write.

Usage

ASP.NET markup: <speech:SemanticItem BindOnChanged="..." />
Get value: Boolean = SemanticItem.BindOnChanged;
Set value: SemanticItem.BindOnChanged = Boolean;
Data type: System.Boolean
Required: No; Default: False

Remarks

If BindOnChanged is True, then binding occurs whenever the item's value changes; if False, binding occurs only when the item's value is confirmed.

Example

The following example is based on SASDK Employing Confirmation and Correction Strategies sample.

<form id="Form1" method="post" runat="server">
  ...
    <asp:panel id="SpeechPanel" runat="server"> 

      <speech:semanticmap id="TheSemanticMap" runat="server">
          <speech:semanticitem id="siSize"    runat="server" BindOnChanged="true" targetelement="pdPizzaSize" targetattribute="value"></speech:semanticitem>
          <speech:semanticitem id="siTopping" runat="server" BindOnChanged="true" targetelement="pdPizzaTopping"
        targetattribute="value"></speech:semanticitem>
      </speech:semanticmap>

      <speech:qa id="PizzaSize" runat="server">
          <Prompt PromptSelectFunction="SizePrompt" BargeIn="False" ID="Prompt1"></Prompt>
          <Answers>
            <speech:Answer ConfirmThreshold="1" SemanticItem="siSize" ID="PizzaSize_QAPizzaSize" XPathTrigger="/SML/Size"></speech:Answer>
          </Answers>
          <Reco InitialTimeout="3000" BabbleTimeout="10000" EndSilence="1000" ID="Reco1">
        <Grammars>
            <speech:Grammar Src="Grammars/ToppingAndSizeGrammar.grxml" ID="Grammar1"></speech:Grammar>
        </Grammars>
          </Reco>
          <ExtraAnswers>
            <speech:Answer ConfirmThreshold="1" SemanticItem="siTopping" ID="PizzaTopping_QAPizzaSize" XPathTrigger="/SML/Topping"></speech:Answer>
          </ExtraAnswers>
      </speech:qa>

      <speech:qa id="PizzaToppingICSize" runat="server" xpathacceptconfirms="/SML/Accept" xpathdenyconfirms="/SML/Deny">
          <Prompt PromptSelectFunction="ToppingICSizePrompt" BargeIn="False" ID="Prompt2"></Prompt>
          <Answers>
            <speech:Answer ConfirmThreshold="1" SemanticItem="siTopping" ID="PizzaTopping_QAPizzaTopping" XPathTrigger="/SML/Topping"></speech:Answer>
          </Answers>
          <Reco InitialTimeout="3000" BabbleTimeout="10000" EndSilence="1000" ID="Reco2">
        <Grammars>
            <speech:Grammar Src="Grammars/ToppingICSize.grxml" ID="Grammar2"></speech:Grammar>
        </Grammars>
          </Reco>
          <Confirms>
            <speech:Answer ConfirmThreshold="1" SemanticItem="siSize" ID="ConfirmSize" XPathTrigger="/SML/Correction/Size"></speech:Answer>
          </Confirms>
      </speech:qa>

      <speech:qa id="CfmToppingSize" runat="server" xpathacceptconfirms="/SML/Accept" xpathdenyconfirms="/SML/Deny"
          firstinitialtimeout="1000">
          <Prompt PromptSelectFunction="CfmToppingSizePrompt" BargeIn="False" ID="Prompt3"></Prompt>
          <Reco InitialTimeout="3000" BabbleTimeout="10000" EndSilence="1000" Reject="0.5" ID="Reco3">
        <Grammars>
            <speech:Grammar Src="Grammars/CfmToppingSize.grxml" ID="Grammar3"></speech:Grammar>
        </Grammars>
          </Reco>
          <Confirms>
            <speech:Answer ConfirmThreshold="1" SemanticItem="siTopping" ID="Topping_QACfmToppingSize" XPathTrigger="/SML/Correction/Topping"></speech:Answer>
            <speech:Answer ConfirmThreshold="1" SemanticItem="siSize" ID="Size_QACfmToppingSize" XPathTrigger="/SML/Correction/Size"></speech:Answer>
          </Confirms>
      </speech:qa>

      <speech:command id="CmdHelp" runat="server" scope="SpeechPanel" type="Help" XPathTrigger="/SML/Command/Help">
          <grammar id="GlobalCmdHelp" runat="server" src="Grammars/GlobalCommands.grxml" />
      </speech:command>

      <speech:command id="CmdRepeat" runat="server" scope="SpeechPanel" type="Repeat" XPathTrigger="/SML/Command/Repeat">
          <grammar id="GlobalCmdRepeat" runat="server" src="Grammars/GlobalCommands.grxml" />
      </speech:command>

      <script>
        function DoStartOver() {
          document.location.reload();
        }
        function GetSIValue(theSI) {
          return(theSI == null ? null : theSI.value);
        }
      </script>
  </asp:panel>
  ...
</form>

See Also

SemanticItem Class | SemanticItem Constructor | SemanticItem Members | SemanticItem Properties | SemanticItem Methods | SemanticItem Events | SemanticItem Remarks | SemanticItem Client Object