repeating table with optional section-adding rows - InfoPath Dev
in

InfoPath Dev

repeating table with optional section-adding rows

Last post 12-29-2005 12:51 AM by mar. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 12-28-2005 03:22 PM

    • mar
    • Top 500 Contributor
    • Joined on 09-04-2005
    • Poland
    • Posts 37

    repeating table with optional section-adding rows

    I have a repeating table with 'field1' and 'field2', and in this table i have optional section 'section' with 'field3'.When i'm using:
    row.selectsinglenode("my:field1");
    row.selectsinglenode("my:field2");
    table.appendchild(row);

    Everything is ok, but when i try to add
    [...]
    row.selectsinglenode("my:field3"); or row.selectsinglenode("my:section/my:field3");
    table.appendchild(row);

    i've got an error (System.NullReferenceException). How can i add this section with its field to this row?
  • 12-28-2005 06:21 PM In reply to

    Re: repeating table with optional section-adding rows

    Hi Mar,
    Probably the optional section is not below the row group in the data source. Or, the row object doesn't support indirection to second level or the xpath is just wrong. Check your xpath.


    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 12-28-2005 11:41 PM In reply to

    • mar
    • Top 500 Contributor
    • Joined on 09-04-2005
    • Poland
    • Posts 37

    Re: repeating table with optional section-adding rows

    Hello Patrick,
    Optional section is below the row group in the data source, this looks like this:
    -table
    -field1
    -field2
    -section
    -field3
    When i use 'row.selectsinglenode("my:section");' he accept it, and error is in the next line, when im trying to add field3 :(
  • 12-28-2005 11:43 PM In reply to

    • mar
    • Top 500 Contributor
    • Joined on 09-04-2005
    • Poland
    • Posts 37

    Re: repeating table with optional section-adding rows

    -table
    --field1
    --field2
    --section
    ---field3
  • 12-29-2005 12:42 AM In reply to

    • mar
    • Top 500 Contributor
    • Joined on 09-04-2005
    • Poland
    • Posts 37

    Re: repeating table with optional section-adding rows

    And if i have structure like this:
    myFields->group1->group2->group3->table
    and im getting an error like this:

    System.Runtime.InteropServices.COMException
    Element 'http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-06-07T16:41:35}table' is unexpected according to content model of parent element 'http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-06-07T16:41:35}group3'.

    What thats mean?
  • 12-29-2005 12:51 AM In reply to

    • mar
    • Top 500 Contributor
    • Joined on 09-04-2005
    • Poland
    • Posts 37

    Re: repeating table with optional section-adding rows

    I forgot the code:
    IXMLDOMNode row = thisXDocument.DOM.selectSingleNode("//my:table");
    IXMLDOMNode tabelka = thisXDocument.DOM.selectSingleNode("/my:myFields/my:group1/my:group2/my:group3");

    and im getting this error on 'tabelka.appendChild(row);'
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.