INFOPATH: Drop-down list / combo box filtering while typing
-
Friday, January 21, 2011 11:29 PMI have a drop down list (lookup field) which is rather large. The default OTB list forms will use a combo-box and allow you to edit the text part of the combo box, and while you type it filters the drop-down list to matching items. Nice. When you create an InfoPath form, these combo-boxes are converted to drop-down list boxes, and the filter feature is gone (i know you can type really fast and the list selection will advance, but it's not the same user experience). I tried to change the control to a combo-box type, and you can type in the text part, but nothing happens (other than a little complaint that integers are required). Does anyone know how to implement the filter-while-you-type feature in InfoPath? Thanks much in advance.
Iko
All Replies
-
Sunday, January 23, 2011 1:41 AM
you can create controls for infopath using .net code and deploy it to infopath. Type ahead functionality is a common algorithm and you can find a lot of examples online for how to code the control and add it to infopath. you will have to have some coding skills to pull it off but there is no out of the box trick that I am aware of
you may be able to pull it off whitout writing a custom control, but rather just using the code behind on the existing control to create the type ahead effect.
-
Sunday, January 23, 2011 1:59 AM
You can't add code to InfoPath list forms.
SharePoint Architect || Microsoft MVP || My Blog
Planet Technologies || SharePoint Task Force- Marked As Answer by GuYumingMicrosoft Contingent Staff, Moderator Wednesday, February 09, 2011 4:13 AM
-
Sunday, January 23, 2011 2:53 AM
the list populates as a lookup from another sharepoint list? you may be able to accomplish this with javascript, or you can create a custom field control and deploy it. For the infopath code behind, I was thinking of a pure form library, but after re-reading I see this is not the situation.
The javascript can get data from a sharepoint list and feed it into an array and can intercept the keystrokes in the sharepoint form control and with a little coding provide type ahead functionality. how many list items are you talking about?
I could imagine this being done with a custom control as well using the client object model, but I cannot say I have investigated this type of option enough to give you a definite answer. I think either way you are looking at decent coding effort, but not an extravagant amount of work.
-
Sunday, January 23, 2011 2:57 AMWhere would the Javascript be? You can't add JS to any browser forms even if they're form library templates. Where would you put all this stuff? When you say "SharePoint form control," how does that relate to an InfoPath list form? What Iko is talking about here is a list that has been converted to InfoPath, which utilizes the special InfoPath list form template, which cannot have code of any type and are browser forms.
SharePoint Architect || Microsoft MVP || My Blog
Planet Technologies || SharePoint Task Force -
Sunday, January 23, 2011 4:16 AMThanks for your help. One workaround could be to use rules triggered by a TEXT field change and resulting in a query for a secondary data connection... it would be very slow though...
Iko -
Sunday, January 23, 2011 4:23 AM
if the javascript could not be added to a page with an infopath list form (which it can, but I am not sure if you can hook it up to the specific HTML <select> element that is ultimately generated from an infopath dropdown list), then either solution would be in lieu of trying to accomplish it through the infopath list form.
Iko, are you trying infopath list forms in hopes that it will provide the functionality you require or are the infopath list forms mandatory and you need to make this work inside of them?
-
Wednesday, February 09, 2011 4:20 AMModeratorAnyway, i did not see the difference between OTB list form and InfoPath customized list form as to the lookup field. It is dropdown list in both case on my test system.
-
Sunday, April 29, 2012 5:15 PM
Has anyone have solution for this? I also need this.
Regards Amit

