Delete current row from repeating table in Infopath 2010 webform on SPS 2010 - InfoPath Dev
in

InfoPath Dev

Delete current row from repeating table in Infopath 2010 webform on SPS 2010

Last post 12-02-2012 09:33 PM by martinjgreen. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 12-02-2012 08:34 PM

    Delete current row from repeating table in Infopath 2010 webform on SPS 2010

    Hi folks,

    I was trying to delete the current row in a repeating table using a button in the row itself with an action to run the command:

    concat("Delete /xpath=/my:ElectronicChangeControlForm/my:TaskSection/my:TaskTable/my:Task[", count(preceding-sibling::my:Task) + 1, "]")

    Which of course tested ok in the InfoPath client, but when I deployed it to SharePoint didn't work.

    Any ideas how to do this in a webform? Tried a few solutions with no luck

  • 12-02-2012 08:47 PM In reply to

    Re: Delete current row from repeating table in Infopath 2010 webform on SPS 2010

    Did the qRules Error field show an error?  Have you double-checked that the button has Postback set to Always?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-02-2012 08:51 PM In reply to

    Re: Delete current row from repeating table in Infopath 2010 webform on SPS 2010

    No, the postback happened correctly, and the row was deleted BUT the preceding sibling axis evaluated as zero, so the +1 then always deleted the first row. I believe this is because it doesn't evaluate correctly in browser forms
  • 12-02-2012 09:23 PM In reply to

    Re: Delete current row from repeating table in Infopath 2010 webform on SPS 2010

    Alright, I've resolved this.

    Essentially, the expression above won't work in a browser form (the count will give 0, then add one, deleting the first row). However the following will produce the desired behaviour in a browser form: 

    concat("Delete /xpath=/my:ElectronicChangeControlForm/my:TaskSection/my:TaskTable/my:Task[", count(preceding-sibling::*[local-name() = "Task"]) + 1, "]")

  • 12-02-2012 09:27 PM In reply to

    Re: Delete current row from repeating table in Infopath 2010 webform on SPS 2010

    This is rather puzzling.  We've used qRules delete in browser forms and had success with it.  I'm surprised that you ran into this behavior, but glad that you found a resolution.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-02-2012 09:33 PM In reply to

    Re: Delete current row from repeating table in Infopath 2010 webform on SPS 2010

    hey Jimmy, The problem isn't with delete - that works perfectly in browser forms.

    The problem is that preceding-sibling::my:Task doesn't work in browser forms, so the above concat'd command won't work to delete the current row as it's recommend for in this thread. Instead it needs to be changed to preceding-sibling::*[local-name() = "Task"]) to work in a browser form.

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.