Locate the current row in a repeating table and update the fields through button click. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Locate the current row in a repeating table and update the fields through button click.

Last post 01-14-2013 07:15 AM by Jimmy. 24 replies.
Page 2 of 2 (25 items) < Previous 1 2
Sort Posts: Previous Next
  • 12-07-2011 04:39 PM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    Is my:Treatment inside the same repeating group as your button? If so, you want:

    string xhtmlRTFField = domNavTreatment.SelectSingleNode("my:Treatment", NamespaceManager).InnerXml ;

    Hilary Stoupa

  • 12-08-2011 01:07 AM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    The problem is that //my:Treatment is an absolute XPath instead of a relative one.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-08-2011 08:41 AM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    I tried switching to an absolutel path.  Even when I use the absolute path below, it still only grabs the value of the first group.row.  When I create 5 instances and click on the "apply to all" button on the 5th row, it grabs the value of the first row.  I thought "e" put you on the row the button was clicked on?

    XPathNavigator domNavTreatment = e.Source.CreateNavigator();
    string xhtmlRTFField = domNavTreatment.SelectSingleNode("/my:myFields/my:GIGroup/my:Years/my:Lines/my:FinancialAllocation/my:Treatment", NamespaceManager).InnerXml;
    MessageBox.Show(xhtmlRTFField);

  • 12-08-2011 08:44 AM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    You don't want an absolute path. You want a relative path. Assuming your button is in FinancialAllocation - you want "my:Treatement". If your button is in Lines, you want "my:FinancialAllocation/my:Treatment"

    Hilary Stoupa

  • 12-08-2011 09:06 AM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    I tried "my:FinancialAllocation/my:Treatment" but it threw an error so I tried "//my:FinancialAllocation/my:Treatment" but that pulled the first rows drop down value again.

    Here is the full xpath to the field that resides in the repeating section that I am trying to grab:

    /my:myFields/my:GIGroup/my:Years/my:Lines/my:FinancialAllocation/my:Treatment

    FinancialAllocation
    is the name of the repeating section.  "Treatment" is the name of the drop down with the values that I am trying to grab using the button that sits next to the drop down on the same line.

    Here is a screenshot to help show what it looks like.

     

     

  • 12-08-2011 10:03 AM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    If you use "//" you will get the first instance, as "//" selects nodes in the document from the current node that match the selection no matter where they are.

    Did you try my:Treatment yet, as I initially suggested? If the repeating group is FinancialAllocation, I'd expect my:Treatment to work.

    Hilary Stoupa

  • 12-08-2011 10:41 AM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    Yes I tried it but unfortunately it didn't work.  It still grabs the value from the first row.....

  • 12-08-2011 11:00 AM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    Paste in your code?
    Hilary Stoupa

  • 01-13-2013 07:44 PM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    Hi Jim,

    can we achieve last() row of a repeating table without the help of code and for a browser based form? I mean using OOB rule/actions/functions? I want to store value of a field in repeating table's newly/last added row.

    thank you before hand :)

    Thank you
    Raj
  • 01-14-2013 07:15 AM In reply to

    Re: Locate the current row in a repeating table and update the fields through button click.

    To set values in rows right at the time a row is added, you can place the rules on the repeating group itself.  Is that what you are looking to do?
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 2 of 2 (25 items) < Previous 1 2
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.