Fully Editable Drop-Down List Box - InfoPath Dev
in

InfoPath Dev

Fully Editable Drop-Down List Box

Last post 04-15-2005 09:25 AM by Agni Jonnalagadda. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-13-2005 07:36 PM

    Fully Editable Drop-Down List Box

    I'm trying to add entries to a repeating section programmatically just like the example Fully Editable Drop-Down List Box.

    Like in the example, I built:
    - a group (/my:myFields/my:logHistorySection/my:logHistoryGroup)
    - a repeating section with an expression box inside the group
    (/my:myFields/my:logHistorySection/my:logHistoryGroup/my:fieldName)

    But everytime the code is invoked, an error of "Object doesn't support this property or method" occurs at the line executing "appendChild" method.
    This is the code I followed from the sample:
    ----------------------------------------------------------------------
    function msoxd_my_formType::OnAfterChange(eventObj)
    {

    var logHistoryGroup = XDocument.DOM.selectNodes("/my:myFields/my:logHistorySection/my:logHistoryGroup");

    var sOld = eventObj.OldValue;
    var sNew = eventObj.NewValue;

    if(sNew != "")
    {
    var oNode = XDocument.DOM.createNode(1, "my:fieldName", "http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-03-04T02:16:49");

    oNode.text = "test value";

    logHistoryGroup.appendChild(oNode);
    }
    }
    ----------------------------------------------------------------------

    Any idea why the error is happening?

    Thanks :)
  • 04-15-2005 09:25 AM In reply to

    Re: Fully Editable Drop-Down List Box

    In statement
    var logHistoryGroup = XDocument.DOM.selectNodes (/my:myFields/my:logHistorySection/my:logHistoryGroup");

    XDocument.DOM.selectNodes gets the array of nodes(IXmlDomNodeList). we cannot add the nodes to this object. Instead we should get the parent node and append children to that node.

    so your statement should be

    var logHistoryGroup = XDocument.DOM.selectSingleNode("/my:myFields/my:logHistorySection/my:logHistoryGroup");
    ...
    logHistoryGroup.appendChild(oNode);


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