Insert a row in a repeating section on different view. - InfoPath Dev
in

InfoPath Dev

Insert a row in a repeating section on different view.

Last post 08-17-2007 02:17 AM by nukkumatti. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-02-2007 12:50 AM

    • anujQA
    • Not Ranked
    • Joined on 08-02-2007
    • Posts 9

    Insert a row in a repeating section on different view.

    Hi,

    I am trying to insert a row in a repeating section. I am having the button to implement this functionality on a view which is different than the view on which the repeating section is present.

    To to this, I first switch to that view and try inserting the row using

    thisXdocument.View.SwitchView("View Name");

    thisXdocument.View.ExecuteAction("xCollection::Insert", "xmlToEdit Name");

    But this does not work. It gives me an error that Operation Not Defined and View.ExecuteAction unknown Name.

    The same ExecuteAction works if my button is on the same view.

    Please let me know the solution for this.

    Also can anyone tell me why OnSwitchView event is not called for View.SwitchView("View Name").

    Thanks in advance.

     

  • 08-08-2007 02:30 PM In reply to

    Re: Insert a row in a repeating section on different view.

    When you switch views, the new view is not ready by the time the next lines of script run. In fact, I believe it won't be ready until the script returns control to the form. Thus, this method will never work.

    Repeating tables are stored in the DOM. The view is just a representation of the DOM. To do this, just write code to add XML to the DOM in the form of a new row in the repeating node.

  • 08-08-2007 11:07 PM In reply to

    Re: Insert a row in a repeating section on different view.

    if you don't wanna write code here the quick and dirty solution. have the repeating table in the same view in which your button is. set conditional formatting on it so that it is allways hidden. copy the repeating section into your second view where you want to show it and remove the conditional formatting from there. hope this helps.
    Listen to Motörhead cos they play Rock'n Roll :)
  • 08-16-2007 03:31 PM In reply to

    Re: Insert a row in a repeating section on different view.

    That's a good solution... Thanks for sharing it!

  • 08-16-2007 11:53 PM In reply to

    Re: Insert a row in a repeating section on different view.

    Hi Jerome,

    That solution rocks! I need to start listening to Motorhead.

    :)

    Patrick Halstead
    Project Manager at Qdabra
  • 08-17-2007 02:17 AM In reply to

    Re: Insert a row in a repeating section on different view.

    thx for the flowers. glad i could help.
    Listen to Motörhead cos they play Rock'n Roll :)
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.