JScript operators - InfoPath Dev
in

InfoPath Dev

JScript operators

Last post 09-06-2007 09:17 AM by spudy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-06-2007 04:03 AM

    • spudy
    • Top 150 Contributor
    • Joined on 03-23-2006
    • United Kingdom
    • Posts 67

    JScript operators

    I have programmatically cloned a row from a repeating table which has repeating tables nested within with a structure as follows:

    my:firstgroup/my:firstrepeatinggroup/my:secondgroup/my:secondrepeatinggroup/my:thirdgroup/my:thirdrepeatinggroup

    My clone node works but I then need to iterate through each row of the clone to change a UID value. This value is repeated for each row of the nested repeating tables also. IE within my:firstrepeatinggroup/my:1stid  my:secondrepeatinggroup/my:2ndid etc. I have managed to iterate successfully through the first and second levels but my if statement seems to fail me on the third:

     if ( 3rdIDfield.nodeTypedValue == 2ndIDfield.nodeTypedValue && 3rdIDfield.nodeTypedValue !== "")

    If I understand this correct if the 3rdIDfield is not blank and is the same as 2ndIDfield then returns true. But alas no! Can someone help me out here?

    Thanks

  • 09-06-2007 09:17 AM In reply to

    • spudy
    • Top 150 Contributor
    • Joined on 03-23-2006
    • United Kingdom
    • Posts 67

    I cannot delete this post but I have found out where the probem was. Firstly I changed the statement to include more brackets...

     if ( (3rdIDfield.nodeTypedValue == 2ndIDfield.nodeTypedValue) && (3rdIDfield.nodeTypedValue !== ""))

    I created a variable to ascertain the ID for the cloned row:
     var 2ndIDfield = 2ndList.item(x).selectSingleNode("my:2ndItemID");
    Then I set the value of the ID of the cloned row to the next unique ID:
     2ndList.item(x).selectSingleNode("my:2ndItemID").nodeTypedValue = newWorkItemID;

    My subsequent for...if statements compared the value of the variable 2ndIDfield.nodeTypedValue. I expected this variable to retain the original value and not retain reference to the actual node thereby altering as I changed the values within the cloned row.

    Well i know this now, and apologies if this rambling makes no sense.....

     

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