Using buttons to populate a Drop-Down ListBox - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Using buttons to populate a Drop-Down ListBox

Last post 03-02-2010 09:24 PM by Qazi Anis. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-01-2010 01:32 PM

    Using buttons to populate a Drop-Down ListBox

    I'm trying to use buttons to populate a ListBox with specific values. I have:

    Buttons 

    A  B  C  D  E  F  G  H  I

    X Y Z 

    ListBox with Clients

    Acme, Corp

    ABC, Corp.

    What I would like to be able to do is for the user to click on one of the letter buttons, and the listbox would populate with a list of clients whose last names begin with the letter on the button. I was looking at doing this via code, but with the amount of data I have, the listbox takes too long to load. Now I'm hoping to be able to do without any code, but I have not been able to figure out the correct way just yet. Do I need a separate Data Connection for each letter? ex: v_AllClientsA, v_AllClientsB. Or just 1 Data Connection that returns all clients and I can create some type of filter? Thanks!

    Joe

     

  • 03-01-2010 09:38 PM In reply to

    Re: Using buttons to populate a Drop-Down ListBox

    you will have to bind the list to some repeating control (or the data retrieved from your data connection). while binding the data make sure you are filtering the data based on the value of the button_field

    then on button click set value to some field say button_field to the caption of the button. i.e. if the user clicks button name A, the value of the button_field should be A.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 03-02-2010 06:38 AM In reply to

    Re: Using buttons to populate a Drop-Down ListBox

    I got it to work.

    Just to recap what I did:

    I added a textbox field. On each button, I set in a Rule 2 things: 1 is to set the value of my textbox field to the letter value of the button that was clicked. And 2, I query my data connection that returns clients(When creating the Data Connection, make sure the 'Automatically retrieve data...' option is not checked).

    On the Listbox, for the filter, I am filtering where the clientname begins with fieldname(where fieldname is the letter value set in the rule).

    Works great. Thanks!!

  • 03-02-2010 09:24 PM In reply to

    Re: Using buttons to populate a Drop-Down ListBox

    hello joemanc,

    good you got it working, the only thing i would suggest is to fetch data automatically unless your data keeps changing, because fetching the data at every button click will result in more database hits.

    Qazi Anis
    Technical Architect
    Bitwise Inc
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.