Buttons to navigate through records in a table - InfoPath Dev
in

InfoPath Dev

Buttons to navigate through records in a table

Last post 08-15-2006 09:58 AM by jsmith. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-19-2004 06:13 AM

    • Lee
    • Not Ranked
    • Joined on 07-23-2004
    • United Kingdom
    • Posts 18

    Buttons to navigate through records in a table

    Hi,

    I have a repeating table that is used as the master table in a form. I am trying to make four buttons to navigate through the records (first, last, previous and next). the problem i am having is how to reference the table row, in such a way that the buttons dont navigate through the data source but through the elements in the data source that are displayed in the table (the table has been filtered).

    I assume htis will have something to do with the position() function, but as ihave already mentioned i can not find a way to reference that particular table.

    thanks for your help

    Lee

    PS. Thanks Patrick and Greg on a great site that has already been a great help to me.

    Lee A Newson
  • 08-20-2004 01:25 PM In reply to

    Re: Buttons to navigate through records in a table

    Lee,

    Yes, you can do this. I have an InfoPathDev.com Example I've started, but haven't had time to finish and post yet that shows how to select a Master table row using code.

    You will need to extract your form files and open the view .xsl file to get a piece of data for this to work.

    Let's say you wanted to hook this code up to the Next Row button, it would look similar to this:

    var oMasterTable = XDocument.DOM.selectSingleNode("//my:group1");
    var iRow = parseInt(XDocument.GetNamedNodeProperty(oMasterTable, "CTRL1_5", 1));
    XDocument.SetNamedNodeProperty(oMasterTable, "CTRL1_5", iRow + 1);
    Notes:
    • The my:group1 would be replaced with the node for your Master Table.

    • From the view .xsl file, you need to get the middle parameter. It can be found by doing a search for "GetNamedNodeProperty".

    • The third parameter for Get... is the default value to use in case nothing is found.

    • The third parameter for Set... is the value you want to set for this named node property.

    • You'll need to special case the upper and lower bounds to make sure your don't go below 1 and above the row count.

    Have fun, and let me know how it works and what you think!!

    Greg Collins [InfoPath MVP]
  • 08-15-2006 09:58 AM In reply to

    • jsmith
    • Not Ranked
    • Joined on 08-04-2006
    • USA
    • Posts 5

    Re: Buttons to navigate through records in a table

    What is the comparable method for retreiving the selected row of a repeating table in C# using the InfoPath 2007 Managed Object Model? I've been racking my brains, and finally come to the realization that you can't just change a few words here or there and have it work.

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