Problem displaying repeated fields

I want the following XForm to add either a foo:beta element or one of the
two foo:delta elements shown in xf:instance each time I press one of the
trigger buttons. Adding beta works, and each of the xf:instance delta
elements shows up on the form when I first load the form into XSmiles .82,
but clicking "Add red delta" or "Add blue delta" doesn't add anything to the
form, although they do add those elements to the instance created by the
submission. What am I doing wrong?

thanks,

Bob

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ev="http://www.w3.org/2001/xml-events" 
      xmlns:xf="http://www.w3.org/2002/xforms"
      xmlns:foo="http://foo">
  <head>
    <xf:model id="model1">
      <xf:instance>
        <foo:alpha>
          <foo:beta color="yellow"/>
          <foo:delta color="red"  flavor="mint"/>
          <foo:delta color="blue" direction="north"/>
        </foo:alpha>
      </xf:instance>
      <xf:submission id="s01" method="put" action="file:///temp/alpha.xml"
/> 
    </xf:model>
  </head>

  <body>

    <xf:trigger id="addBetaButton">
      <xf:label>Add Beta</xf:label>
      <xf:insert nodeset="foo:beta" at="last()" position="after"
                 ev:event="xforms-activate"/>
    </xf:trigger>

    <xf:trigger id="addDeltaBlueButton">
      <xf:label>Add blue Delta</xf:label>
      <xf:insert nodeset="foo:delta[@color='blue']"
                 at="last()" position="after"
                 ev:event="xforms-activate"/>
    </xf:trigger>

    <xf:trigger id="addDeltaRedButton">
      <xf:label>Add red Delta</xf:label>
      <xf:insert nodeset="foo:delta[@color='red']"
                 at="last()" position="after"
                 ev:event="xforms-activate"/>
    </xf:trigger>

    <xf:submit submission="s01">
      <xf:label>Save</xf:label>
      <xf:hint>Click here to save your alpha document.</xf:hint>
    </xf:submit>

    <xf:repeat nodeset="foo:beta">
      <xf:input ref="."><xf:label>beta</xf:label></xf:input>
      <xf:input ref="@color">
        <xf:label>beta color</xf:label>
      </xf:input>
    </xf:repeat>

    <xf:repeat nodeset="foo:delta[@color='red']">
      <xf:input ref="@color">
        <xf:label>delta color</xf:label>
      </xf:input>
      <xf:input ref="@flavor">
        <xf:label>delta flavor</xf:label>
      </xf:input>
    </xf:repeat>

    <xf:repeat nodeset="foo:delta[@color='blue']">
      <xf:input ref="@color">
        <xf:label>delta color</xf:label>
      </xf:input>
      <xf:input ref="@direction">
        <xf:label>delta direction</xf:label>
      </xf:input>
    </xf:repeat>

  </body>
</html>

Received on Wednesday, 5 November 2003 12:49:33 UTC