Default checked multi-Select list box - InfoPath Dev
in

InfoPath Dev

Default checked multi-Select list box

Last post 09-15-2014 08:16 AM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-18-2012 12:44 PM

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Default checked multi-Select list box

     please could sombody help, this seems like it should be really easy to do but i just cant figure it out or find anything on here or google.

    I have a multi select list box in an infopath 2010 form, (its actually a sharepoint list form, and the multi select is a look up from another list that allows multiple values)  All i want to do is have the check boxes next to the items automatically checked when the form loads then the user unchecks the items they do not want. (there could be hundreds of choices so its quicker to uncheck than to check)

     Can anybody help with this?

     

     

  • 06-18-2012 12:49 PM In reply to

    Re: Default checked multi-Select list box

    Here is the real issue you are going to have with this -

    The multi select checkbox is bound a repeating field. When you select an item, another instance of the repeating field is added by InfoPath. You would need to either:

    1. Programatically add the correct number of instances for your repeating group and set all of them to the correct values (qRules can also do this for you, and if you are a qRules user, let me know and I can help you).
    2. Set the form to include enough instances by default of the field, then set them all using rules or default values.
    Hilary Stoupa

  • 06-18-2012 01:23 PM In reply to

    • beanyjon
    • Not Ranked
      Male
    • Joined on 02-22-2012
    • Coventry, UK
    • Posts 22

    Re: Default checked multi-Select list box

    So as my choices are likely to change as users input more and more, there is no way to dynamically set all to checked even with Qrules?
  • 06-18-2012 02:12 PM In reply to

    Re: Default checked multi-Select list box

    With qRules you could - you could check to see if the form was new, use the Insert command to insert the same number of instances of the field as you have in your secondary data connection that provides the list, then use some form logic to set the value of each. Let me know if you are interested in the qRules approach and I can put together a quick sample for you.

    Hilary Stoupa

  • 08-26-2014 07:36 AM In reply to

    Re: Default checked multi-Select list box

    Hi Hilary,

    Do you have  a q rules example of this?  (I have done it in code before...but really don't want to add code to my form

    Catharine

  • 08-27-2014 08:03 AM In reply to

    Re: Default checked multi-Select list box

    So, the attached sample has a rule on the qRules finishedLoading node and on the repeating field the multi-select is bound to. I've also added a helper attribute to the main data source that I would usually put in a form logic XML. The repeating field is set in the defaults to not be included by default.

    Hilary Stoupa

  • 09-15-2014 03:52 AM In reply to

    Re: Default checked multi-Select list box

     Hi Hilary,

    Thank you for the example. I have this working perfectly in my preview form.   When I publish and use it in the browser I get the correct number of rows added to the repeating group, but they are all empty.  i.e. the SharePointListItem_RW[count(current()/preceding-sibling::SiteLocation) + 1]/Title  doesn't seem to work in the browser.  I have made sure that the Postback settings are to Always.

    Any ideas?

  • 09-15-2014 08:16 AM In reply to

    Re: Default checked multi-Select list box

    Do you have any other rules that may be affecting the group? Like a sort rule or anything? Can you try the sample form in the browser and see if it works?

    Hilary Stoupa

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