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

RE: How to use insert and delete actions

From: David Landwehr <dlandwehr@novell.com>
Date: Tue, 8 Feb 2005 12:30:33 +0100
To: <www-forms@w3.org>
Message-Id: <20050208113032.EC097262893@pfepc.post.tele.dk>
Hi Catherine,

The contexts for both the delete and the insert actions are the current item
in the repeat. Your nodeset expression would have been correct if the delete
and insert was outside the repeat. To get the behavior you want you should


<xforms:delete nodeset="." at="1" ev:event="DOMActivate"/> 

<xforms:insert nodeset="." at="1" position="before" ev:event="DOMActivate"/>


Best regards,




From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On Behalf
Of Catherine Poinsignon
Sent: 8. februar 2005 10:46
To: www-forms@w3.org
Subject: How to use insert and delete actions


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"
                <meetings xmlns="">
                    <meeting day="monday" starthour="10.00">
                        <title>Sample meeting</title>


I display the record using a repeat :


        <xforms:repeat id="meetings_index" nodeset="meeting">
                <xforms:input ref="title">
                <xforms:select1 appearance="minimal" ref="@day">
                <xforms:select1 ref="@starthour">
                    <xforms:label>Sarts hour</xforms:label>
                    <xforms:action ev:event="DOMActivate">
      <xforms:delete at="index('meetings_index')"
                            ev:event="activate" nodeset="meeting"/>


I wanted to add a new record by this 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


But it does not work : neither the delete, neither the new !!!

Could you please help me ?

Thanks in advance...



Received on Tuesday, 8 February 2005 11:30:36 UTC

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