Update a repeating Table - InfoPath Dev
in

InfoPath Dev

Update a repeating Table

Last post 07-08-2011 12:36 PM by Shyam23. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-13-2011 01:23 PM

    Update a repeating Table

    Hi

    I have a repeating table with Edit buton in it, i entered four rows in the table,

    on click of edit button in row 3 i am redirecting the user to other view in which entire data is polulate, and on modification in that page if user clicks on save i am updating Repeating table in view 1 with New data.

    Problem here is only row1 is getting update every time.

    ========================================================= 

    XPathNavigator DOM1 = e.Source.CreateNavigator();

    iRowName1 = DOM1.SelectSingleNode("my:field7", NamespaceManager).Value;

    iRowField31 = DOM1.SelectSingleNode("my:field8", NamespaceManager).Value;

    XPathNavigator root = this.MainDataSource.CreateNavigator();

    root.SelectSingleNode("/my:myFields/my:group1/my:group2/my:field2", NamespaceManager).SetValue(iRowName1);

    root.SelectSingleNode("/my:myFields/my:group1/my:group2/my:field3", NamespaceManager).SetValue(iRowField31);

    ========================================================================== 

    view 2 is having few texboxes and dropdowns in a  section control.

  • 06-19-2011 04:01 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Update a repeating Table

    You need to tell Infopath which row to update e.g. /my:myFields/my:group1/my:group2[2]/my:field3. would populate row 2
  • 07-07-2011 08:56 AM In reply to

    • Shyam23
    • Not Ranked
      Male
    • Joined on 06-10-2011
    • Atlanta
    • Posts 19

    Re: Update a repeating Table

    Hi Skarn,

         This might be naive. I can use your formula to retrive a particular field in a row(say row2). What do I need to do if I need to send an email to a field in the current row? i.e everytime a user enters a new row, the form needs to send an email to a field in that particular row.

  • 07-07-2011 11:58 PM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    I've attached a form with two methods.

    The first is a bit stylish by having a checkbox (or radio button if you wanted) where the user can indicate the current row and a rule with an xpath filter on the output field retrieves the email field value from the selected row.
    This only needs code to mimic the behaviour of a radio button (to make sure only one check box is ticked at a time).

    The second method is simple and requires no code - but every row in your repeating table will have a button in the last column.
    When a row button is pressed, the current() xpath function is used to retrieve the email field value from the row the button is in.

    If you wanted to you could use the checkbox method do allow multiple selections and the use eval, or a bit more jscript looping to retrieve all the selected rows and emails to send to multiple emails at once.

    Hope this helps.

  • 07-08-2011 10:05 AM In reply to

    • Shyam23
    • Not Ranked
      Male
    • Joined on 06-10-2011
    • Atlanta
    • Posts 19

    Re: Update a repeating Table

     HI Skarn,

         Thanks for your reply. However, I am not able to open your form. I guess you need to change the permission to domain.

    Thanks,

     

    Shyam

     

  • 07-08-2011 10:10 AM In reply to

    Re: Update a repeating Table

    You'll need to save the file locally (right click the link, save as...) then right click the locally saved file and select Design. This will open the template in Design mode. They don't care much for being moved.

    Hilary Stoupa

  • 07-08-2011 12:36 PM In reply to

    • Shyam23
    • Not Ranked
      Male
    • Joined on 06-10-2011
    • Atlanta
    • Posts 19

    Re: Update a repeating Table

     Thank you Hilary and Skarn! That worked You guys rock!

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