0

I have a list on a site that was created by importing an Excel spreadsheet.

I have several lookup columns that were deployed to the site using a feature. Going into the site columns gallery, I see them all there, and they look to be set up correctly.

I have several other lists that use the lookup columns, also deployed with the same feature, pre-populated with items. Going to those lists, I see the all the items as expected and the lookups are correctly connected.

(The feature basically sets up the back-end for SPServices cascading dropdowns.)

When I go to add the lookup columns to the list created by importing the Excel file, they seem to add without issue. They are listed among the existing list columns, and identified as lookup columns.

When I open the Edit form, however, the dropdown controls are not rendered. The labels for the fields are on the form, but there's no actual control to use to choose a value.

What gives?

As a test, I did create a brand new custom list, added my lookup columns, they worked fine on their own, then I added the SPServices script, and the cascading dropdowns worked as well. So I know it doesn't have to do with the columns themselves, it's very specific to this other list.


After doing some more testing, I can see that after adding the columns to the list, they are added correctly to both the Schema XML of the list, and to the Item content type on the list. Everything seems in place for the fields to be included on the Edit form, and indeed they are (like I said, the labels are there, just not the dropdown controls).

What could be a reason for the dropdown controls not rendering?

1 Answer 1

0

I have discovered what was going wrong.

Unbeknownst to me, the person creating the list by importing the Excel spreadsheet would then go in through SPD, delete the default Edit form, create a new edit form, and customize it to remove several fields they did not want showing on the form.

Deleting the default Edit form also deleted the default list form web part, and the new form that was created by SPD used a Data View Web Part instead. The XSL used by the DVWP is generated at the time the form is created, so all fields get hard coded into the XSL. When I came along later and added new fields (the lookups), they did not get added to the XSL for the form.

Going in through SPD and deleting and re-creating the form after I added the lookup fields solved the problem. New XSL was generated that included my fields, and the field controls render correctly now.

So it wasn't really a problem about lists created by importing Excel files, it was about lists that have new forms created through SPD.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.