Delete element on save/submit via Orbeon Form Builder

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Delete element on save/submit via Orbeon Form Builder

ayubmalik
Hi,

I am using Orbeon Form Builder to generate a form. I would like to delete an element from the model when the form is saved.

I have tried to create a delete action base on the examples  in this link  but cannot get it to work

Given the instance

<xf:instance id="fr-form-instance">
   <guide>
      <title/>
      <media>
          <format>image</format>
      </media>
      <media>
         <format>video</format>
      </media>                   
    </guide>
</xf:instance>


I have the following delete action within my <xf:model> to delete the last media element

<xf:delete ev:event="xforms-submit" nodeset="guide/media" at="last()"/>

But it does not work.

I have also tried  

<xf:delete ev:event="xforms-submit" nodeset="media" at="last()"/>

and

<xf:action ev:event="xforms-submit">
    <xf:delete nodeset="media" at="last()"/>
</xf:action>

Any ideas?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Delete element on save/submit via Orbeon Form Builder

Alessandro  Vernet
Administrator
Hi Ayub,

I think Michael Sperberg-McQueen  posted a pretty good answer to this one on http://stackoverflow.com/a/17243513/5295, but just let us know if for some reason that answer didn't help or you can't figure out why the delete isn't deleting anything.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Delete element on save/submit via Orbeon Form Builder

ayubmalik
I am still having problems with this.
I tried putting a modal message in as well but nothing appeared, just a 'spinner' icon