preceding-sibling question - InfoPath Dev
in

InfoPath Dev

preceding-sibling question

Last post 05-11-2006 12:03 PM by chandero. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 02-22-2006 07:16 PM

    • Carlos
    • Top 500 Contributor
    • Joined on 01-24-2006
    • Australia
    • Posts 31

    preceding-sibling question

    I have a repeating section (from table Project_Phase). One of the fields is Phase_Number, in which I wish to automatically populate with number (eg 1, 2, 3 etc), BUT, also have the ability to renumber itself if one of the repeating rows is deleted. From what I have read, the preceding-sibling code is the way to go, but I cant get it to work. Can someone please explain the syntax for it. Eg, I have count(preceding-sibling::*/Project_Phase) + 1 but it doesnt count, just keeps using 1 as the number. (this code is placed in a text box properties, Value field)

    Cheers,
  • 02-22-2006 07:19 PM In reply to

    • Carlos
    • Top 500 Contributor
    • Joined on 01-24-2006
    • Australia
    • Posts 31

    Re: preceding-sibling question

    BTW:, I found another post with more or less the same issue

    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1793&SearchTerms=preceding-sibling
  • 02-23-2006 07:45 PM In reply to

    • Carlos
    • Top 500 Contributor
    • Joined on 01-24-2006
    • Australia
    • Posts 31

    Re: preceding-sibling question

    Figured it out, thought ill post it in case theres more questions about it.

    Under the field where you want the number to autoincrement, go to its properties, click the Value button and type count(preceding-sibling::*/@Field) + 1 (where @Field is your increment field).

    Cheers,
  • 02-23-2006 11:18 PM In reply to

    Re: preceding-sibling question

    Hi Carlos,
    Welcome to our forum and thanks for sharing your knowledge with us! :)

    Patrick Halstead [InfoPath MVP]
    InfoPath Dev Seattle
    Patrick Halstead
    Project Manager at Qdabra
  • 02-24-2006 07:29 AM In reply to

    Re: preceding-sibling question

    Cool solution! The problem in the thread was a namespace issue, but this XPath is namespace-independent. I posted a link in the other thread to this thread.

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-11-2006 12:03 PM In reply to

    Re: preceding-sibling question

    I tried the example you show (cannot figure out how to find namespace) and also the other one (without namespace) and cannot get it to work at all. I still get a 1 in each row I add. I looked at the sample Invoice that increments the item number whan you add a row. But there is no code that I could find that shows how to increment. The formula for the item field is 1.
    Any help in pointing me to an answer will be greatly appreciated.
    Thanks,
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.