Button and new blank row in a repating table - InfoPath Dev
in

InfoPath Dev

Button and new blank row in a repating table

Last post 02-20-2007 06:26 AM by Matt Faus. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-16-2007 02:16 AM

    Button and new blank row in a repating table

    Hello,
    I'm sorry for my "terrible" english...

    I have an Infopath module with a repeating table.
    In this module I have a button he inserts two particolar data in the last row of my table, I'd like also, when I push this button, to automatically insert a new blank row in my table?

    Is it possible in VBScript?
    Thanks,
    Checco
  • 02-16-2007 02:48 AM In reply to

    Re: Button and new blank row in a repating table

    Hi Checco and welcome to the forums,
    Check this link,
    http://infopathdev.com/forums/topic.asp?TOPIC_ID=282

    Hope this heklps you!
    Shilpa
    INFOPATHDEV India
  • 02-16-2007 07:59 AM In reply to

    Re: Button and new blank row in a repating table

    Hello,
    thank for your help!!!

    This is my code:

    sRepeatingXml = "<my:Prestito xmlns:my='http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-01-18T17:05:24'><my:Utente></my:Utente><my:DataPrestito></my:DataPrestito><my:DataRestituzione></my:DataRestituzione></my:Prestito>"
    XDocument.UI.Alert(sRepeatingXml)
    Set oXml = XDocument.CreateDOM()
    oXml.async = false
    oXml.loadXML(sRepeatingXml)
    parentofRepeatingNode = "//my:Libro"
    XDocument.DOM.selectSingleNode(parentofRepeatingNode).appendChild(oXml.documentElement)

    This code works well and he creates the new line in the table, but the new line has two obligatory fields (my:DataPrestito and my:DataRestituzione), I want this fields "free"

    Thaks,
    Checco.
  • 02-20-2007 06:26 AM In reply to

    Re: Button and new blank row in a repating table

    Hi Checco and welcome to the forum!

    I'm not exactly sure what you mean by "free", but I think you are talking about setting the xsi:nill attribute, which can be done by changing your XML string to the following:

    <my:Prestito xmlns:my='http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-01-18T17:05:24' xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'>
    <my:Utente></my:Utente>
    <my:DataPrestito xsi:nil='true'></my:DataPrestito>
    <my:DataRestituzione xsi:nil='true'></my:DataRestituzione></my:Prestito>


    I think this will solve the problem - good luck!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.