accessing last node of repeating section at run time - InfoPath Dev
in

InfoPath Dev

accessing last node of repeating section at run time

Last post 07-02-2011 12:03 PM by DaveA. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-01-2009 07:32 AM

    • onjus
    • Not Ranked
    • Joined on 05-23-2009
    • Posts 8

    accessing last node of repeating section at run time

    Hi all,

    i have certain problem of accessing last node of repeating section at run time. plz see below stucture for clarity

     

    - RepeatingSection

    •   field1
    •   field2
    •   field3

     

         

     At run time there are 20 copies of my rereating section made.my problem is to access field1 in 20th repeating section in code.it can be done in infopath2003 using indexer.but i want to know how it can be done in infopath2007 ?

    Thanks for help in Advance

     

  • 06-01-2009 08:18 AM In reply to

    Re: accessing last node of repeating section at run time

    Please don't post the same question in multiple forums.

    You can use simple XPath selection to get the last node of any repeating section, so for example if I wanted to access field1 in the last group2 group (and group2 is repeating) I would use in C#:

    XPathNavigator lastField1 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1/my:group2[last()]/my:field1", NamespaceManager);

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 06-01-2009 11:19 PM In reply to

    • onjus
    • Not Ranked
    • Joined on 05-23-2009
    • Posts 8

    Re: accessing last node of repeating section at run time

    Thanks jimmy for help , i will take care from next time onwards ;-)

  • 07-02-2011 12:03 PM In reply to

    • DaveA
    • Not Ranked
    • Joined on 06-19-2011
    • Posts 3

    Re: accessing last node of repeating section at run time

    Could you give me the same in Jscript please?
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.