Introducing the Autocomplete Text Field for SharePoint 2007

Yesterday I finally had some time to finish a project I've been working on for some time: the Autocomplete Text Field for SharePoint 2007. Click here for a small demo screencast on Soapbox, or download the high resolution video from the CodePlex site.

The idea is pretty simple: you've got a SharePoint list (or document library) that contains some interesting lookup data, now you can make use of the Autocomplete Text Field to display a textbox to the user that will show a dropdown list of items that start with the text the user already entered. When the user types more (or less) text, the dropdown list will adapt to that and update the contents. All of this is made available as a new column type (aka custom field type) in SharePoint 2007. The beauty of this field is that it doesn't need to do a page postback to refresh the data, the ASP.NET AJAX extensions are used to fetch the data in the background.

When the column is added to a SharePoint list or document library, the user can customize by defining various settings:

  • Column name: the name of the column
  • Description: the description of the column
  • Required: if the column should contain text or if it can stay empty
  • Lookup list: the list in which the column should do the lookup, this list can be selected from a dropdown
  • Autocomplete interval: the number of milliseconds after which the lookup list will appear
  • Items to display: the maximum number of items to display in the lookup list
  • Minimum prefix length: the minimum number of charactes which should be typed before the lookup list will appear
  • Show animations: enable or disable the fading effects when the lookup list is shown or hidden

For more information, the download and the source code; visit the SmartTools for SharePoint Codeplex site. Be aware that if you want to make use of this column, the ASP.NET AJAX extensions must be installed and configured on your SharePoint sites!! (more info here)

11 Comments

  • Nice control Jan!
    The only thing I would like to see is that you can choose the column to display, as the normal lookup field does.

  • Nice post and nice feature !

    I haven't played with it but one cool feature would be also to be able to select the field to bound the autocomplete (for exemple this could be the title field, but also the name field, etc.).

    Thanks for giving this to the community anyway !

  • Do you think it's reasonable, performance-wise, to use the autocomplete lookup against a list with ~1500-2000 items?

    We're trying to build a drop-down control that will present a user with a selection from ~1500 items and this seems like a great way to go; if the performance is ok...

    thanks

  • @bob: thanks for the suggestion! I will take this into account for the next version.

    @denap: I don't think there's a performance issue. To optimize performance you can set the minimum prefix length to something like 4, so no unnesecarry round trips to the server are made.

  • I am familiar with the auto complete extension of ASP.NET Ajax. I used it in non SharePoint web apps.

    I'm having a problem with this field. I link it to a simple list that has a title column. The autocomplete field does not show a text box in the list item edit mode. In design mode it does show all the property controls.

    What can I do to solve this problem?

  • Why did you go GPL here (and not in any of your other CodePlex projects)? This looks like a truely useful feature, but anything GPL can't be used in most business settings. Bummer.

  • Jan, I'm not having any luck getting the lookup working. Installed fine, shows up as a column type fine. I have a simple list of countries I'm using as the lookup list, yet when I add a new item and enter data into the field; no response.

  • I Can a Little English, so Understand
    A little problem, though.
    Installed fine, Show Column type fine,
    but typing in a text box is Result to not response show
    I Think Problem is Web Service not excute.

  • Thanks for sharing this but it's not working at all. As stated by the others, field is showing up, typing a text in it doesn't trigger any response. No error in event log nor in Sharepoint's log files.

    Installed the AJAX extensions successfully and tried Mike Amerlaan's webpart example successfully too which means that ajax is well working. Trying your custom field in the same Sharepoint site is just not doing anything...very disapointing.

    Cheers

  • Hello Jan,

    Sorry for my message of yesterday, it works great but for some reason not in all site collections although it's in the same web application....and the solution you made is deployed accross the entire farm. Could it be related to some extra feature not activated ?

    But otherwise, I tested it and it's pretty fast and pretty comfortable for the end user.

    John.

  • Hi Jan,

    Is it possible to add an item to a list if it doesn't exist? Could you have a some little option that says add new list item?

    Bill

Comments have been disabled for this content.