resetting repeating table form - InfoPath Dev
in

InfoPath Dev

resetting repeating table form

Last post 12-23-2008 10:16 PM by swathip. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-23-2008 11:38 AM

    resetting repeating table form

    i have a form that i am using simple rules on the submit button to reset values after submission to "". the problem is there is a repeating table, so if they add 10 items, it just resets all 10 items to "" instead of just resetting it back to 1 row.  is there a way to do this via simple rules or does code behind have to happen?
  • 12-23-2008 08:39 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: resetting repeating table form

    Hello,

    This is possible using code. We have to write the code to replace the existing repeating nodes (10) with one repeating node from sample DOM.

  • 12-23-2008 10:16 PM In reply to

    Re: resetting repeating table form

      Hi,

    Here is the code to implement the functionality that you have mentioned. It is in c#.

    [InfoPathEventHandler(MatchPath = "CTRL24_5", EventType = InfoPathEventType.OnClick)]

     public void CTRL24_5_OnClick(DocActionEvent e)

     {

     

    IXMLDOMNode group10Node = thisXDocument.DOM.selectSingleNode("/my:myFields/my:group9/my:group10");

    IXMLDOMDocument2 sampleDataDom = (IXMLDOMDocument2)thisXDocument.CreateDOM();

    sampleDataDom.setProperty("SelectionNamespaces", "<Your form name space>");

    sampleDataDom.load("sampledata.xml");

    IXMLDOMNode sampleGroupNode = sampleDataDom.selectSingleNode("/my:myFields/my:group9/my:group10");

    IXMLDOMNodeList group10List = thisXDocument.DOM.selectNodes("/my:myFields/my:group9/my:group10");

    ((IXMLDOMSelection)group10List).removeAll();

    IXMLDOMNode group10ParentNode = thisXDocument.DOM.selectSingleNode("/my:myFields/my:group9");

     group10ParentNode.appendChild(sampleGroupNode);

     }

    Here /my:myFields/my:group9/my:group10 is the repeating node xpath.

    Swathip
    www.ggktech.com
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.