Programmatically add new row to repeating table and set values from text boxes - InfoPath Dev
in

InfoPath Dev

Programmatically add new row to repeating table and set values from text boxes

Last post 12-14-2010 05:56 AM by bradbee. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 12-14-2010 05:56 AM

    Programmatically add new row to repeating table and set values from text boxes

    I have a couple individual text boxes and a repeating table with two corresponding fields.

    When I click a button I want to take those two values in the text boxes and insert them into the repeating table. This will be done several times per form.

    Here is some code I put together just trying to make it work. It's moving the values to the repeating table but each time I click the button it just overwrites the first line and never creates a new line. I know I'm missing a big part of moving nodes but not sure where to go from here to do that.

    As an added note, I'm using Infopath 2010.

    Public Sub btnAddItem_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)

    Dim addXpath As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("my:myFields", NamespaceManager)

    Dim addWOField As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("my:myFields/my:addWO", NamespaceManager)

    Dim addSerialField As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("my:myFields/my:addSerial", NamespaceManager)

    Dim manifest As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1/my:group2", NamespaceManager) manifest.SelectSingleNode("my:WoNum", NamespaceManager).SetValue(addWOField.Value)manifest.SelectSingleNode("my:serial", NamespaceManager).SetValue(addSerialField.Value)

    addXpath.SelectSingleNode("my:addWO", NamespaceManager).SetValue("")

    addXpath.SelectSingleNode("my:addSerial", NamespaceManager).SetValue("") End Sub

     

     

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