Populate repeating table from another - InfoPath Dev
in

InfoPath Dev

Populate repeating table from another

Last post 12-10-2009 11:09 AM by dngo4579. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 07-28-2006 12:47 AM

    Populate repeating table from another

    hi,

    I hope someone coud help me to solve my problem...

    In my form I got a repeating table in a section wich can be signed by our users. Now I try to display the entries of this repeating table in another view. In this view some users should be able to edit the entries without changing the original table and loosing the signature. I just want to populate the second repeating table based on the entries of the first one.

    Is there any opportunity to do this with Infopath?

    Chris
  • 07-28-2006 04:39 AM In reply to

    Re: Populate repeating table from another

    Hi,

    Check out this link,
    http://infopathdev.com/forums/topic.asp?TOPIC_ID=1926

    I hope this will help you,
    Thanks.
    K.Ramana Reddy / http://www.ggktech.com
    India.
  • 07-31-2006 03:59 AM In reply to

    Re: Populate repeating table from another

    quote:
    Originally posted by K.Ramana Reddy

    Hi,

    Check out this link,
    http://infopathdev.com/forums/topic.asp?TOPIC_ID=1926

    I hope this will help you,
    Thanks.



    Thank you for your answer. I tried it and it works.

    But I still don`t know how to solve my problem...
    To copy the whole content of one repeating table to another.
    I don`t know so much about DOM so that it is not that easy for me.
    It would be very helpful if anybody got a code example how to handle it. (I`m using jscript)

    Chris
  • 07-31-2006 10:45 AM In reply to

    Re: Populate repeating table from another

    Hello leGeneral, I have done this with JScript before and it's not too bad. You'll want to look at the cloneNode() and appendChild() of an XML node object.

    var oDocument = XDocument.DOM.selectSingleNode("/my:myFields/my:Document");
    oDocument.appendChild(oSamplePage.cloneNode(false));

    This HowTo has some code snippets that performs XML rearrangements:http://www.infopathdev.com/howto/tutorials/default.aspx?i=80c11a66b08a4572bc2b17f391319a0f
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 08-02-2006 10:53 PM In reply to

    Re: Populate repeating table from another

    Thank you Matt!

    I found a solution. I solved it this way...

    	var domRepOrig = XDocument.DOM.selectNodes("/my:meineFelder/my:Antrag/my:Informationen/my:Positionen");
    var domRepNew = XDocument.DOM.selectNodes("/my:meineFelder/my:StatusBA/my:AntragBA/my:AntagspositionenBA");
    var oSampleRow = domRepNew.nextNode();

    domRepNew.removeAll();

    while (oSrc = domRepOrig.nextNode()){
    var oNewRow = oSampleRow.cloneNode(true);
    oNewRow.selectSingleNode("my:kategorieBA").text = oSrc.selectSingleNode("my:kategorie").text;
    oNewRow.selectSingleNode("my:artikelNrBA").text = oSrc.selectSingleNode("my:artikelNr").text;
    oNewRow.selectSingleNode("my:anzahlBA").text = oSrc.selectSingleNode("my:anzahl").text;
    oNewRow.selectSingleNode("my:beschreibungAntragBA").text = oSrc.selectSingleNode("my:beschreibung").text;
    oNewRow.selectSingleNode("my:investArtBA").text = oSrc.selectSingleNode("my:investArt").text;
    oNewRow.selectSingleNode("my:inventarNrBA").text = oSrc.selectSingleNode("my:inventarNr").text;
    oNewRow.selectSingleNode("my:preisBA").text = oSrc.selectSingleNode("my:preis").text;

    XDocument.DOM.selectSingleNode("my:meineFelder/my:StatusBA/my:AntragBA").appendChild(oNewRow);
    }


  • 08-03-2006 09:23 AM In reply to

    Re: Populate repeating table from another

    Thanks for sharhing you solution with us. I'm glad you got it solved!
  • 12-10-2009 11:09 AM In reply to

    Re: Populate repeating table from another

    How do you write that code in c#????

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