SharePoint Lookup: a different approach

It took me several days to get this to work, but in the end it was worth it. To recap, when a lookup list contains more than 20 items, IE renders the control as an input control that behaves like a SharePoint choice type. The control allows type ahead capability, which is probably why MS did it that way, but the control is very different than a dropdown. In a dropdown, all you have to do to cascade is to rebuild the select/options. So, every time dropdown #1 changes, I rebuild dropdown #2 select/option. I am using SP Web Services to read the dropdown #2 list using dropdown #1 selected item value.

The choice type makes it difficult but not impossible to cascade lookup values. You just have to use another approach. My approach was stop fighting SP and deal with the choice type. I did two things: 1) determine if the control has changed to input/choice, 2) build/rebuild the choice items (control.choices) for the control using the list item values.

This worked as designed and I deployed this it this morning. Glory be. Now, I can move onto something new, although I learned a great deal from this experience.

When time permits, I will post the code, although it is very complicated removing anything from work.

Comments are closed.