Dynamic Multi-Select Listbox - detecting checked value - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Dynamic Multi-Select Listbox - detecting checked value

Last post 07-25-2012 03:38 AM by rajkumar.bathula. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 11-23-2009 08:41 AM

    Dynamic Multi-Select Listbox - detecting checked value

    Hello, 

    I have found this forum helpful in the past and thought that since I could not find an answer via google or on this site, some members could help me with this.

    Although this post is close to what I want to do:  http://www.infopathdev.com/forums/t/13563.aspx  it is not really what I want to do.

    I am Populating a multi-selection list box with filtered data from a secondary data source.  Each item listed in the control is unique.

    What I cannot figure out is how to detect when a user has checked a value in that control.  Both the display and value of each item is the same.

    What I want to do is detect when an item is checked and use that value from the multi select listbox to populate a text box whose formula would use the sum() function to dynamically give a full pricing total of all checked items in the multi-selection list box.

    If you need additional information, please specify what you would need from me.

    Thanks A Lot!

     

    -Fritz

  • 11-23-2009 05:05 PM In reply to

    Re: Dynamic Multi-Select Listbox - detecting checked value

     It's usually easier to provide a concrete answer when we know the structure of your data source.  Could you provide a screenshot of your data source indicating:

    1. The location of the node bound to the multi-selection list box.
    2. The location of the prices.
    3. The location of the nodes related to each price that correspond to the values in the multi-selection list box (i.e., so we know which prices to choose, and which not to).
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-23-2009 08:08 PM In reply to

    Re: Dynamic Multi-Select Listbox - detecting checked value

     

    Jimmy, Thanks For Your Response.

    a.  The location of the node bound to the multi-selection list box.
     
    b.  The location of the prices.  (see below for both B & C)

    c.  The location of the nodes related to each price that correspond to the values in the multi-selection list box (i.e., so we know which prices to choose, and which not to).

     Secondary Data Source

        Jimmy:  So, what I am doing is populating the MultiSelect List box with items from Product column in the Secondary Data source (above).  I am filtering the values that can be shown in the Multi-select list box with the value from another field.  Everything to this point is okay and I have accomplished.

     So what I want to do is this:

    • Multi-Select List Box has unique filtered values provided from the Secondary Data Source   (accomplished)
    • Since the multi-select list Display Name and Value are both equal to :Product  (see below), I need to use these values as filters on the :Price column to do the following step (Not accomplished)
    • .ListBox
    • sum() all :Price values from the secondary data source which have their :Product values selected in the Multi-Select List Box in the InletSensorsSubtotal textbox field in the Main Data Source.

    I hope this is helpful.  Thanks A Lot for your assistance, Jimmy!!   Also, prefer to use XPath expressions instead of code.

    -Fritz


  • 11-23-2009 09:14 PM In reply to

    Re: Dynamic Multi-Select Listbox - detecting checked value

    The attached form should be close to what you're trying to do.  It uses the sum() function with some relatively simple XPath selection.  Like in the other example you indicated, you'll need to put the formula in the default value and in a rule.

    Please let me know if this is sufficient for what you need to do.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-23-2009 11:22 PM In reply to

    Re: Dynamic Multi-Select Listbox - detecting checked value

     Thanks Jimmy.

    I know for the sake of purity, I probably should be using straight XML for my data sources, but what I neglected to tell you (im sorry) is im using an Access 2007 DB (to be exported to SQL server in the future).

    But, I did figure out how to do what I am looking for with a confirmation button and rules. 

    Basically what I did was set up a button with the following rules:

    • sum(@Price[@Product = InletSensors[//InletSensors != ""]])    <!--  Just looking for NON blank values in the Multi-Select Box to match to my Secondary Data Source's Price List as per my previous post-->
    • InletSensorConfirm = true()   
    • The only conditional on the rules was that InletSensorConfirm = FALSE

    The Second rule refers to a boolean drop-down list box ( as opposed to a check box) that had its conditional display settings set to be hidden - whether it was true or false. ( so as to hide it at all times from the end user).  It has a default value of false()   I use this control to toggle whether the user has 'Confirmed' their selections in the multi Selection box.  If it is = true() i disable the multi-select box. 

    I tried to apply the first rule to the multi Selection List Box itself and found the following - what I call - 'Quirk':     Anytime I selected a value in the Multi Select Check Box as 'CHECKED', the rule would run and the proper total was calculated (Great!), but when any of the 'CHECKED' values were Un-CHECKED the rule would not recalculate (thereby causing the total field to remain as though nothing  was un-CHECKED) until any other option, including the one I just Un-CHECKED was set to CHECKED.   There were no conditions on the rule running.

    That simply could not work since I am not assured that the salesperson using the form would mark anything else CHECKED after un-checking something.

     If you have any thoughts on how I could remove the hidden toggle field so that the rule runs at all times, whether or not another item is checked as described above.

    Thanks again!

     -Fritz

  • 11-24-2009 06:59 AM In reply to

    Re: Dynamic Multi-Select Listbox - detecting checked value

    Hello again.  Glad to hear you're making some progress.

    fschick:
    I tried to apply the first rule to the multi Selection List Box itself and found the following - what I call - 'Quirk':     Anytime I selected a value in the Multi Select Check Box as 'CHECKED', the rule would run and the proper total was calculated (Great!), but when any of the 'CHECKED' values were Un-CHECKED the rule would not recalculate (thereby causing the total field to remain as though nothing  was un-CHECKED) until any other option, including the one I just Un-CHECKED was set to CHECKED.   There were no conditions on the rule running.
     

     I am aware of this quirk and actually mentioned it in the thread you referenced, and my previous post in this thread.  To get around it you need to use a default value in addition to a rule.  Have you tried setting a default value formula on InletSensorsSubtotal?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-24-2009 08:01 AM In reply to

    Re: Dynamic Multi-Select Listbox - detecting checked value

    Thanks again.

     Indeed, that does work.

    Then the lesson is:  The solution in the referenced post applies to most attempts to ascertain values via an XPath formula from a muti-select list box's selected values.

    Thanks a lot.

    -Fritz

  • 03-29-2010 11:40 PM In reply to

    Re: Dynamic Multi-Select Listbox - detecting checked value

    It is believed that browser enabled InfoPath forms do not support multiple selection list box.

    But there is a work around for this.

     I have posted a step-by-step approach along with the source code to makemultiple selection list box a possibility with browser enabled InfoPath forms.

     Read my full post at: http://www.sharepointfix.com/2010/03/creating-multi-select-list-box-in.html

    Regards,

    The SharePoint Fix Team

    Mehul Bhuva
    My daily learnings on Sharepoint, InfoPath, Nintex
    http://www.sharepointfix.com
  • 07-25-2012 03:38 AM In reply to

    Re: Dynamic Multi-Select Listbox - detecting checked value

    Hi

    I am having different issue with multiselect list box and disabling it in InfoPath 2010 and administrator approval form publishing method.

    In detail:

    I am having a section that contains multiselect list box. This section will be hidden/displayed based on some other control value on the Form. In this case, when i am giving Disable option using Formatting rule for my multiselect list box, I am getting error message as 'object reference not set to an instance' while uploading my publishied form to  Form Templates in Central Admin.

    If i place my multiselect list box outside section and write disable formating rule, it is working fine.

    Conclusion: Disable formating rule is throwing error when my multiselect list box is placed in section which is bydefault hidden and will be displayed later point of time.

     

    please help me out. let me know if you need any more information

     

    thank you beforehand.

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