Is it possible to dynamically create multiple repeating tables on the fly - InfoPath Dev
in

InfoPath Dev

Is it possible to dynamically create multiple repeating tables on the fly

Last post 03-19-2008 04:18 PM by Greg Collins. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-17-2008 04:09 PM

    Is it possible to dynamically create multiple repeating tables on the fly

    First off, I spent hours doing a search on this board and others for the answer with no luck. So here goes: 

    Is it possible to create multiple repeating tables with code on the fly? I can  already create and insert rows into a Repeating table with code.
    However, it only seems to work if I add the corresponding fields and repeating table in the form template beforehand.  What if I want to dynamically create a new repeating table inside a loop on the fly for every row in the loop? The key here is that I don't know before I run my program, how many of these repeating tables I will need unitl runtime. Is it possible to do this without having these fields in the template beforehand? Please help as I have an urgent deadline. Thanks so much in advance.

  • 03-17-2008 04:56 PM In reply to

    Re: Is it possible to dynamically create multiple repeating tables on the fly

    You cannot design the XML in the MAIN DOM at runtime. However, you might be able to pull this off in a secondary DOM. Even though there is a schema associated with the secondary dom, InfoPath doesn't hold you to it at runtime. So you might be able to pull that off.

    HOWEVER!! In order to design the view to display those dynamic tables, you need to have some design-time structure available to bind your controls to. Thus it doesn't really matter what you might do in the background, you have to have some kind of a structure any way (in advance) in order to show those tables.

    Your best bet is to develop a workable XML structure that will allow you to "look like" you are being all dynamic about things.

  • 03-17-2008 06:11 PM In reply to

    Re: Is it possible to dynamically create multiple repeating tables on the fly

     thanks again! I think Ill go the shape route. I think its a bit bizarre that you can't create the MAIN DOM at runtime! I spent 3 days trying to get it to work. I wish i knew it wasnt possible :)

    But out of curiosity, how would one go about doing this on a secondary DOM? 

     

  • 03-18-2008 11:00 AM In reply to

    Re: Is it possible to dynamically create multiple repeating tables on the fly

    You can create an XML file and add it to your template as a secondary DOM. Then, using code you can add/remove nodes all you want. This has to be done using code (as appropriate to the coding language you are using).

    But again, the DISPLAY of those nodes requires that they exist during design time or you cannot bind controls to them in the view... so it's really not much help to go this route.

    Really, some smart thinking and you can probably design a general enough structure that you can pull of what you are trying to accomplish with a fixed schema.

  • 03-18-2008 12:52 PM In reply to

    Re: Is it possible to dynamically create multiple repeating tables on the fly

    thanks Greg. You've been a tremendous help on both of my topics. Much appreciated. 

  • 03-19-2008 04:18 PM In reply to

    Re: Is it possible to dynamically create multiple repeating tables on the fly

    Glad to have helped!

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