Accessing individual rows of a repeating table - InfoPath Dev
in

InfoPath Dev

Accessing individual rows of a repeating table

Last post 11-27-2008 09:48 PM by swathip. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-27-2008 01:48 PM

    Accessing individual rows of a repeating table

    Hi All,

    I have a repeating table consisting of two columns (contact name and contact type). I would like to be able to update and delete individual rows of this table. Therefore, I added two buttons per row for Save and Delete and use the below code to delete, for example. The problem is that AppContactID always receives value from the first row. so, whenever I delete second or third row, it always tries to delete first row. What am I doing wrong here?

    function btnContactDelete::OnClick(eventObj)
    {
    if (XDocument.UI.Confirm("Are you sure?",4)==6)
    {
     var AppContactID = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:SQLComplexDB/d:AppContact/@AppContactID").text;

     if(AppContactID != null)
     {
      XDocument.QueryAdapter.Command = "delete dbo.AppContact where AppContactID =  " + AppContactID;
      XDocument.Query();
      RefreshItemQuery();
     }
    }
    }

    Thanks

  • 11-27-2008 09:48 PM In reply to

    Re: Accessing individual rows of a repeating table

    Hi,

    Here in your code every time you are taking the first row AppcontactId. Instead of that get the contact id of the present row. For that use the following code line.

    var AppContactID = eventObj.source.selectSingleNode("@AppContactID").text;

    Hope this will solve your problem.

    Swathip
    www.ggktech.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.