receiving log - Creating textboxes - InfoPath Dev
in

InfoPath Dev

receiving log - Creating textboxes

Last post 07-05-2005 02:47 PM by Agni Jonnalagadda. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 06-28-2005 09:49 PM

    • craigp
    • Not Ranked
    • Joined on 06-29-2005
    • USA
    • Posts 5

    receiving log - Creating textboxes

    I am trying to create receiving log for when our warehouse guys get in equipment they have to enter a serial # for every item that is received. I have a textbox for a quantity, and I need to have textboxes added for what ever is entered in the quantity field. Is this possible and how do I go about doing it?

    Thanks

    Craig
  • 06-28-2005 11:37 PM In reply to

    Re: receiving log - Creating textboxes

    Hi Craig and welcome to the forum!
    How many textboxes do you need to add? Is the number conditional on the quantity added? Should be easy to do.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 06-29-2005 08:50 AM In reply to

    • craigp
    • Not Ranked
    • Joined on 06-29-2005
    • USA
    • Posts 5

    Re: receiving log - Creating textboxes

    Yes the number of textboxes is conditional to the quantity, ie. if they type 4 for the quantity, 4 textboxes will appear. :)

    Thanks
  • 06-29-2005 03:17 PM In reply to

    Re: receiving log - Creating textboxes

    Yes it is posible, you need to write an OnAfterChange event on Quatity field and write code to insert the XML nodes depending the quatity.

    Agni
    InfoPathDev India
  • 06-29-2005 03:51 PM In reply to

    • craigp
    • Not Ranked
    • Joined on 06-29-2005
    • USA
    • Posts 5

    Re: receiving log - Creating textboxes

    Is there any examples that you know out there on the web, for doing this?
  • 06-30-2005 02:14 PM In reply to

    • craigp
    • Not Ranked
    • Joined on 06-29-2005
    • USA
    • Posts 5

    Re: receiving log - Creating textboxes

    Can anyone help? PLEASE!!!
  • 07-01-2005 07:44 AM In reply to

    Re: receiving log - Creating textboxes

    Hi Sorry for being late, here is the code.

    In the following code i took data from sampledata.xml, which will have a copy of template.xml. From that i took the Empty textbox, cloned it and appended it to the container of the textbox as many number of times as quantity.

    [InfoPathEventHandler(MatchPath="/my:myFields/my:quatity", EventType=InfoPathEventType.OnAfterChange)]
    public void field1_OnAfterChange(DataDOMEvent e)
    {
    if (e.IsUndoRedo)
    return;
    int quantity = Convert.ToInt32(e.NewValue.ToString());
    IXMLDOMDocument2 oSampleData = (IXMLDOMDocument2)thisXDocument.CreateDOM();
    oSampleData.async = false;
    oSampleData.load("sampledata.xml");
    oSampleData.setProperty("SelectionNamespaces", "xmlns:my=\"http://my\"");
    IXMLDOMNode oSampleNode = oSampleData.selectSingleNode("/my:myFields/my:TextBoxNodes/my:TextBoxNode");
    IXMLDOMNode oTextBoxsParentNode = thisXDocument.DOM.selectSingleNode("/my:myFields/my:TextBoxNodes");
    for(int i=0; i < quantity;i++)
    {
    oTextBoxsParentNode.appendChild(oSampleNode.cloneNode(true));
    }
    }

    Hope this helps!

    Agni
    InfoPathDev India
  • 07-02-2005 10:57 AM In reply to

    • craigp
    • Not Ranked
    • Joined on 06-29-2005
    • USA
    • Posts 5

    Re: receiving log - Creating textboxes

    OKay, sorry for being a pain in the rear here, but can you explain this a little to me. I am very new to XML and Infopath.

    Thanks
  • 07-05-2005 02:47 PM In reply to

    Re: receiving log - Creating textboxes

    I am reading the required Node which has to be inserted in to "oSampleNode" and appending it to the Parent of the node as many times as quantity.

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