Mixed input elements for posting new listitem - InfoPath Dev
in

InfoPath Dev

Mixed input elements for posting new listitem

Last post 03-07-2007 10:36 AM by Greg Collins. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 03-03-2007 05:24 AM

    Mixed input elements for posting new listitem

    Hi!
    I've followed the approach outlined in the "Add SharePoint List Items with InfoPath" article and it works.
    It shows how to post a new list item to a Sharepoint custom list.
    I defined a list with three columns, Title, Description and Priority. For this I use this XML as a data connetion in Infopath (it will be used to post to Sahrepoint through the webservice):
    <?xml version="1.0" encoding="UTF-8"?>
    <Batch OnError="Continue">
    <Method ID="1" Cmd="New">
    <Field Name='Title'></Field>
    <Field Name="Description"></Field>
    <Field Name="Priority"></Field>
    </Method>
    </Batch>

    As outlined in the artice above, I create a data connection to the XML and then a repeating table out of it in the form.
    This renders 3 rows when I test the form with three textboxes.
    However, I would like the Priority input field to render as a Dropdown list wth three possible values (low, medium, high) but do not know how to do this.
    Can anyone help me with this?
  • 03-03-2007 02:23 PM In reply to

    Re: Mixed input elements for posting new listitem

    Instead of adding a repeating table, add a drop-down list box and specify (in the properties dialog box) that you want it to be populated from that data connection you made.
  • 03-04-2007 06:17 AM In reply to

    Re: Mixed input elements for posting new listitem

    But there are 3 <Field Name=''></Field> entries in the XML
    if I bind to the Field element, Infopath tells me this is a repeating section, if I bind a control to it, he will automatically bind to the first such element. What I would like to do is bind 3 different controls to the three different Field entries. Sorry if this is a newbish question, but I cannot seem to find out how to do this.
  • 03-05-2007 09:20 AM In reply to

    Re: Mixed input elements for posting new listitem

    Either I don't understand what it is you want to accomplish, or there is some fundamentals that I need to go over.

    Binding: This is the association between the control (i.e. a drop-down list box) and and XML node (i.e. field) in a DOM. Most commonly, this binding occurs on a Main DOM field, as these are the ones that store the values in a way that can be saved. This binding might also occur on secondary data source fields if you are using Web service, or database or for other special purposes.

    It is never appropriate to bind a drop-down control to a repeating list, which is why you get that error.

    My guess is that you don't really want to bind the control to the list, but that you want to "populate" the control using the list. The binding is for the stored value (i.e. where you want to record the selection from the list that the user made).

    If you really want to bind to the repeating list, then where are you populating the drop-down from? More likely, the list is for population, and the stored value (binding) is somewhere in the Main DOM.
  • 03-06-2007 12:15 AM In reply to

    Re: Mixed input elements for posting new listitem

    I think I explained confusingly :-)
    In the example for inserting items into a custom Sharepoint list, it was suggeted to bind the section
    <Field Name='Title'></Field>
    <Field Name="Description"></Field>
    <Field Name="Priority"></Field>
    to a repeating table, this creates 3 textboxes, although I want the Priority field to bind to a dropdown list with Low, Medium and High values. My problem is that I cannot seem to bind individual elements to the individual Field elements in the XML (2 textboxes and 1 dropdown list), if I bind a textbox to the Field elements he only binds to the first Field element he finds(Title).
  • 03-06-2007 11:52 AM In reply to

    Re: Mixed input elements for posting new listitem

    I now see the problem you are having... You have a repeating group with three identical fields, only the value of their attribute differentiates them. This is a problem, but not without a solution.

    Use a repeating section with a drop-down list box bound to Field. Then filter or use conditional formatting to only show the row where @Name="Priority".

    Does that make sense?
  • 03-07-2007 12:00 AM In reply to

    Re: Mixed input elements for posting new listitem

    That's an interesting solution but one that might work. I'll give it a try :-)
    In the meantime, thank you very much for your time and effort!
  • 03-07-2007 10:36 AM In reply to

    Re: Mixed input elements for posting new listitem

    Great, let me know the results.
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.