Using Date Picker to build a list? - InfoPath Dev
in

InfoPath Dev

Using Date Picker to build a list?

Last post 11-01-2008 11:36 AM by Lalato. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-31-2008 02:32 PM

    Using Date Picker to build a list?

    I have a form and I would like to add a list that users will update with a date picker.  Essentially it's a list of dates that the customer does not want to receive a subscription.  Right now, the user enters the dates manually into a text box.  I would like to give the users the option of picking the dates with the date picker.

    Is there a way to collect the date chosen via date picker and add it to the end of a list?  Right now the only thing I can think of is to do it as a repeating table, but I think that will take up too much space.  When printed, the form is already several pages long.  I don't need any more complaints about length.

    Thanks,
    --sam

  • 10-31-2008 11:46 PM In reply to

    Re: Using Date Picker to build a list?

    Hi, 

    What I understood is you are allowing the user to select date via. Date Picker and what you want to do is you want to make a list for all the dates that are selected by user right?

    For that please follow the steps for implementing your functionality.

    ·         For saving all the dates selected by user you need to have a repeating field in which we save all the dates selected by user.

    o   Add a group in the data source (named " DatesSelectedByUser "). In that add a repeating field (named as “dates”).

    ·         After adding the repeating field in a group. Add an OnAfterChange Event for the date picker. In that add the below lines of code.

     

            [InfoPathEventHandler(MatchPath = "/my:myFields/my:DatePicker", EventType = InfoPathEventType.OnAfterChange)]

            public void DatePicker_OnAfterChange(DataDOMEvent e)

            {

                if (e.IsUndoRedo || e.Operation != "Insert")

                {

                    return;

                }

                IXMLDOMDocument2 sampleDom =  (IXMLDOMDocument2)thisXDocument.CreateDOM();

                sampleDom.async = false;

                sampleDom.validateOnParse = false;

                sampleDom.setProperty("SelectionNamespaces", formNameSpace);

                sampleDom.load("sampleData.Xml");

                IXMLDOMNode dates = sampleDom.selectSingleNode("/my:myFields/my:DatesSelectedByUser/my:dates");

                dates .text = e.NewValue.ToString();

                thisXDocument.DOM.selectSingleNode("/my:myFields/my:DatesSelectedByUser").appendChild(dates);       

            }

    Chandrakanth/GGKTech
  • 11-01-2008 11:36 AM In reply to

    Re: Using Date Picker to build a list?

    Thanks chandrakanth...  you understood correctly.  I'll give this a try and post back here the results.

    Thanks again!
    --sam

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