Fill field repeating table within repeating table - InfoPath Dev
in

InfoPath Dev

Fill field repeating table within repeating table

Last post 07-25-2006 09:51 AM by Greg Collins. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-21-2006 10:41 AM

    Fill field repeating table within repeating table

    I am using VB.Net managed code.

    Thanks to the helpful folks in this forum, I have figured out how to fill a text box in a repeating table. I use

    e.site.selectSingleNode("node name").text = "whatever"

    That works great.

    Now, I have a repeating table nested inside a repeating table. If I use the above code to fill a text box, I get only the first row to work; other rows do not. This is similar to the problem I had before I learned of e.site. In a repeating table, only the first row would be filled properly.

    So, what is the code for nested repeating tables?

    Many thanks!
  • 07-21-2006 04:10 PM In reply to

    Re: Fill field repeating table within repeating table

    Are you trying to set all fields with the same name inside your repeating group to the same value? If so you can do this with Rules... it automatically updates each field of the same name.

    Otherwise, you need to use .selectNodes() rather than .selectSingleNode() to get all the nodes of a particular name. Then you loop through the nodes that were selected and update each one's .text value.
  • 07-21-2006 05:37 PM In reply to

    Re: Fill field repeating table within repeating table

    quote:
    Originally posted by Greg Collins

    Are you trying to set all fields with the same name inside your repeating group to the same value? If so you can do this with Rules... it automatically updates each field of the same name.


    No, not quite.

    What I am doing is grabbing the person's login name from system.environment.username, then when the person checks a box (which is in a row of the repeating table), it fills their log in name. It's a cheap way of signing the form. I have an AfterChange event attached to the check box that fills in the code.

    If I have just one repeating table, the e.site.selectsinglenode works great. It's when I go into nested repeating tables that I run into troubles. I've used it in other situations, and I'm happy with it.

    We're not looking for huge security here, and yes it can be circumvented. The form signers are a tight bunch of co-workers and I am developing a way to quickly see who has seen the various items.


    PS: I really appreciate your help!!!
  • 07-24-2006 03:44 PM In reply to

    Re: Fill field repeating table within repeating table

    Are you using a relative or absolute XPath in your call to e.Site.selectSingleNode()? That makes a difference. It sounds like you just want to update a text box on the same row as the check box. This being the case, your XPath should be relative (i.e. "../my:TextBox").
  • 07-24-2006 05:43 PM In reply to

    Re: Fill field repeating table within repeating table

    Brilliant. Greg, thank you very much again for saving the day. Little by little I'm learning this thing.
  • 07-25-2006 09:51 AM In reply to

    Re: Fill field repeating table within repeating table

    Glad to help. Keep up the good work. Little-by-little, we all become experts!
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.