W3C home > Mailing lists > Public > www-forms@w3.org > February 2005

How to use insert and delete actions

From: Catherine Poinsignon <catherine.poinsignon@lombard.lu>
Date: Tue, 08 Feb 2005 10:46:12 +0100
Message-Id: <s20898b1.082@lombard.lu>
To: <www-forms@w3.org>
Hi all,
I am trying to use the insert and delete actions to insert a new record
in my instance data or delete an existing record. Do do that, I hace the
following instance :
 
            <xforms:instance id="data"
                nweb:pageflow-replace-data="always"
nweb:primary-input-data="true">
                <meetings xmlns="">
                    <meeting day="monday" starthour="10.00">
                        <title>Sample meeting</title>
                    </meeting>
                </meetings>
            </xforms:instance>
 
I display the record using a repeat :
 
        <xforms:repeat id="meetings_index" nodeset="meeting">
                <xforms:input ref="title">
                    <xforms:label>Subject</xforms:label>
                </xforms:input>
                <xforms:select1 appearance="minimal" ref="@day">
                    <xforms:label>Day</xforms:label>
                    <xforms:choices>
    <xforms:item>
        <xforms:label>Monday</xforms:label>
        <xforms:value>monday</xforms:value>
    </xforms:item>
    <xforms:item>
        <xforms:label>Tuesday</xforms:label>
        <xforms:value>tuesday</xforms:value>
    </xforms:item>
    <xforms:item>
        <xforms:label>Wednesday</xforms:label>
        <xforms:value>wednesday</xforms:value>
    </xforms:item>
    <xforms:item>
        <xforms:label>Thursday</xforms:label>
        <xforms:value>thursday</xforms:value>
    </xforms:item>
    <xforms:item>
        <xforms:label>Friday</xforms:label>
        <xforms:value>friday</xforms:value>
    </xforms:item></xforms:choices>
                </xforms:select1>
                <xforms:select1 ref="@starthour">
                    <xforms:label>Sarts hour</xforms:label>
                    <xforms:choices>
 <xforms:item>
        <xforms:label>09.00</xforms:label>
        <xforms:value>09.00</xforms:value>
    </xforms:item>
    <xforms:item>
        <xforms:label>10.00</xforms:label>
        <xforms:value>10.00</xforms:value>
    </xforms:item>
 <xforms:item>
        <xforms:label>11.00</xforms:label>
        <xforms:value>11.00</xforms:value>
    </xforms:item>
 </xforms:choices>
                </xforms:select1>
                <xforms:trigger>
                    <xforms:label>Delete</xforms:label>
                    <xforms:action ev:event="DOMActivate">
      <xforms:delete at="index('meetings_index')"
                            ev:event="activate" nodeset="meeting"/>
                    </xforms:action>
                </xforms:trigger>
            </div>
        </xforms:repeat>
 
I wanted to add a new record by this trigger :
 
            <xforms:trigger>
                <xforms:label>New meeting</xforms:label>
    <xforms:insert at="index('meetings_index')"
                    nodeset="meeting" position="after"/>
    <xforms:setvalue ref="meeting[index('meetings_index')]/title">New
Meeting</xforms:setvalue>
            </xforms:trigger>
 
But it does not work : neither the delete, neither the new !!!
Could you please help me ?
Thanks in advance...
 
Catherine
 




Received on Tuesday, 8 February 2005 10:30:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:59 GMT