identify row in a Repeating Table - InfoPath Dev
in

InfoPath Dev

identify row in a Repeating Table

Last post 01-25-2006 12:35 PM by fredarwin. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-23-2006 08:50 AM

    identify row in a Repeating Table

    How i could take a value from a field of a repeating table before i delete that row.

    I do this, but ip send me a error.

    function msoxd__Avances::OnBeforeChange(eventObj)
    {
    if (eventObj.Operation=="Delete" && oNode=="Compromisos")
    {
    var idx=eventObj.Source.selectSingleNode
    ("/dfs:myFields/dfs:dataFields/.../idavance");
    XDocument.UI.Alert(idx.text); --->('error here!!')
    }
    }


    Fred Darwin Villareal
  • 01-23-2006 11:05 PM In reply to

    Re: identify row in a Repeating Table

    Fred,

    Try something a little more like this:

    var idx = eventObj.Source.parentNode.selectSingleNode( "@idavance" );

    You can use the eventObj to do relative selecting of XML. I hope this helps, let us know how if you have any more questions. Also, if you search around on this forum you might find several code examples to help you out a little more.

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-24-2006 08:38 AM In reply to

    Re: identify row in a Repeating Table

    MFaus i try this:

    var idx = eventObj.Source.parentNode.selectSingleNode("@idavance");
    XDocument.UI.Alert(idx.text);

    But in second line jscript send me error.

    How i can do a data reference to specific cell on repeating table?


    Fred Darwin Villareal
  • 01-24-2006 10:32 AM In reply to

    Re: identify row in a Repeating Table

    i try this too:
    var strUserName = eventObj.Source.selectSingleNode("@idavance").text);

    IP, send me : Source.selectSingleNode(...)' is null or not is a object.

    Is there a way to extract a piece of data in a field on the line that currently has the focus and then do a comparison with that single data point?

    Fred Darwin Villareal
  • 01-24-2006 11:20 AM In reply to

    Re: identify row in a Repeating Table

    Yes, you can do this.

    Your source might need to be "normalized" so try this line instead:

    var idx = eventObj.Parent.selectSingleNode( "@idavance" );

    The error that you listed - null or not an object - is almost always because your XPath is wrong. Check out this tutorial for a helpful start: http://www.w3schools.com/xpath/default.asp

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

    Re: identify row in a Repeating Table

    Thanks MFaus, but i have the same problem.
    with
    var idx = eventObj.Parent.selectSingleNode("@idavance");
    XDocument.UI.Alert(idx.text);--> Error:Object required.

    Why idx is null?

    Thanks for the link to learn XPath, i take the course.


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