Set the value of a following sibling field - InfoPath Dev
in

InfoPath Dev

Set the value of a following sibling field

Last post 03-13-2007 11:06 AM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-09-2007 12:39 PM

    • Pasu
    • Not Ranked
    • Joined on 12-13-2006
    • USA
    • Posts 24

    Set the value of a following sibling field

    I have a repeating table in which I would like to fire rules for the current row and the following rows, whenever a value in the current row changes. The firing should happen in sequence.

    Using 'How To' tips athttp://www.infopathdev.com/howto/tutorials/default.aspx?i=d663d7df90e94e65abb02632966e8127 (Assign an Autogenerated Row Number to a Repeating Field), I created rules on the Autogenerated Row Number field. But, what I found is that the rules fire randomly across rows, thereby causing miscalculations.

    I believe that it is possible, if it is possible to set the value of a following sibling field. Is there any way to set the same?

    Or, if there is any other way to fire the rules in sequence, please post your thoughts.

    Thanks in advance!!
  • 03-12-2007 09:47 AM In reply to

    Re: Set the value of a following sibling field

    With what you want to do, rules should cascade, like dominos falling. Using following-sibling::my:RowNode[1]/my:FieldName to set the row field should work. Note the [1] filter is essential in the XPath to state that you want the very next sibling. Then the rule on that next row should do the same to the one following it, etc.
  • 03-12-2007 11:56 AM In reply to

    • Pasu
    • Not Ranked
    • Joined on 12-13-2006
    • USA
    • Posts 24

    Re: Set the value of a following sibling field

    Thanks for your response, Greg.

    In order to test whether the rules fire in sequence from the current row to the following, I added a 'Show a dialog box expression' action at the end, that would display the row number of the rule being executed and would wait for OK after each row's rules were executed.

    From the above testing, I found that the rules didn't fire in sequence because the row numbers were displayed in random.

    On the other hand, I have been unsuccessfully trying to set the value of following-sibling::my:RowNode[1]/my:FieldName as I could neither edit nor paste the XPath of the field I would like to set the value for.


    Is there any way to edit the XPath of the Field?
  • 03-13-2007 11:06 AM In reply to

    Re: Set the value of a following sibling field

    Ah yes, my mistake. I forgot that rule actions don't let you modify the field xpath. Unfortunately, it is set up so that if you try to edit them manually, it causes further problems.

    What happens with rules where you set a value in a repeating list is that the value of each mathing field in every row gets updated. This is sometimes helpful, but more often than not is a problem. The best alternative is to go to code for this.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.