The bad news is that it took me 7 hours to figure it out. The good news is that I figured it out.
When you define a column in a SharePoint list as type = “Lookup”, and if the list that you are looking up contains more than 20 items, SP renders the dropdown controls as combo box controls. SP also changes the control names. Even worse - if you can believe it - SP changes the behavior of the controls. All this in toto throws my “cascading lookup” software faster than a tsuri komi goshi. Very forbidden.
To add insult to injury, the combo box control is much different than the dropdown control which my software complained bitterly about. For some unknown reason, SP renders combo box code similar to choice controls. Unfortunately, the choice control does not contain select/option tags that my software has its way with. Also very forbidden.
What really “threw” me was that one of my lookups did not morph into a combo box while the others did. Call me simple minded, but it did not occur to me - I would argue it would not occur to any sane individual - that the item count had anything to do with the morphing. I will not bore you with the gory details and the pain and agony I suffered to figure this beast out, but suffice to say that I reached deep into my bag of tricks and came up as empty as the Red Bull that I just polished off.
Bottom line is that I know what is wrong, but I certainly can’t fix it as only Microsoft can undo their dirty work. Overwriting the controls is an option I suppose but it requires .NET ninja powers that I do not have. The “keep the lookup lists below 20 items” solution is not a viable option.
I am relatively new to SharePoint and Microsoft non-office products. How Microsoft can get away with such egregious “bugs” in their software is beyond comprehension. Coming from the stable, tried-and-true, tranquil, happy-go-lucky and carefree world of Java, J2EE, JSPs and Servlets; this new world is unfamiliar and somewhat unsettling.
Additional Info
Update:
3/29/2010: tried to out smart SharePoint today. I created an empty list with a title field that I used as a lookup list. My thinking was that if I point my three lookup columns to the empty list I would not experience the control changing when the item count > 20. Well, it worked great until I saved the item. The error was the standard, “SharePoint has an error”. Oh well, it was a noble effort, unfortunately it did not work. I still don’t understand why. I suppose the column value must be in the lookup list. I tried to trick the beast and I failed. Onward.
3/28/2010: just read a post that states that FF renders the control as select (good - my software likes select) and IE renders to “choice like” control (forbidden). IE is the bad guy. Now, why does that not surprise me? Not sure why they are rendered differently. Unfortunately, in our shop we MUST use IE.