W3C home > Mailing lists > Public > www-forms@w3.org > November 2003

Problem displaying repeated fields

From: DuCharme, Bob (LNG-CHO) <bob.ducharme@lexisnexis.com>
Date: Wed, 5 Nov 2003 12:46:30 -0500
Message-ID: <FEF4858E8AB32D4EAC2CF2A7D85386EBE52E45@lnxdayexch06.lexis-nexis.com>
To: "'www-forms@w3.org'" <www-forms@w3.org>

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?



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


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

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

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

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

    <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:repeat nodeset="foo:delta[@color='red']">
      <xf:input ref="@color">
        <xf:label>delta color</xf:label>
      <xf:input ref="@flavor">
        <xf:label>delta flavor</xf:label>

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

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:10 UTC