Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Creating a List in a Configuration without a ListTemplate

  Asked By: Garret    Date: Aug 06    Category: Sharepoint    Views: 830

As you all may recall, I am working through creating a custom template and
custom webparts for my needs. I hope to report back on some of the secrets
I have learned when I am done, which will be soon!

Here is a dumb question that you'd think straightforward.

1) I have created custom list definitions under the LISTS directory in my
custom site definition.

2) Some (many) of these are 'single use,' meaning I want to create the list
and not have a template to create more, so creating the ListTemplate object
in onet.xml seems useless.

3) I'd just like to create the list in a List object within the
configuration directly without referencing a 'list template' by Type #.

I have played with a number of constructs in the configuration attenpting to
create a list object without a referenced list template and it doesn't seem
possible. Some manifest.xml constructs seem to imply it may be possible,
but I have found no direct documentation on how to create a List within a
Configuration without a List Template.



6 Answers Found

Answer #1    Answered By: Gregg Wilkinson     Answered On: Aug 06

Can anyone shed some light on this question someone asked me today?

"We are modifying a document library so that the end-user can "Profile"
a document. They will apply approximately 7 different attributes to a
document. One of the attributes has a requirement of being a
multi-select from a group of approximately 1500 names (i.e. select
Steve, Carla, Brenda from a list  of 1500 names). This is the one that
is killing me right now."

Answer #2    Answered By: Darrel Sexton     Answered On: Aug 06

I would have the column to be a lookup into another list  however a) any SharePoint list really shouldn’t exceed 1000 items and b) personally picking from a list of 1500 objects is not something I would ever put in front of a user. Just the download of the data, even if it’s cached, through http to populate the list is going to kill you.

An alternate would be a pop-up window similar to the lookup they have in SharePoint for looking up users in AD or the Profile Database. Return the values from that to the parent window and populate it into a text field. You could hook into it through a custom  toolbar on the doclib similar to the “Link to Outlook” link that’s on the Contact list profile.

Answer #3    Answered By: Tory Sellers     Answered On: Aug 06

You’ll still need to add the list  to the definition in order to create it, but when the site gets created through the sitedef you can have it just create your one-off lists once. Mark the lists in the template  as hidden and they won’t show up on the Create page. You can also tag them to only be created on the root web so any sub-sites won’t have them available in any capacity to be created.

Answer #4    Answered By: Agustin Miranda     Answered On: Aug 06

That is what I did. Seems kid of a waste though.
Hiddenlist was kind of an interesting twist. I chose to not set hiddenlist
to true so if the user wants to place the list  on a page it is available in
the browse webparts.

Answer #5    Answered By: Arron Middleton     Answered On: Aug 06

Just one more thought. If you really only want to create the lists once and not bother defining them in the sitedef, you can just create the list  programatically after the site is created with a small utility. Create the list completely through code.

Answer #6    Answered By: Vance Hardin     Answered On: Aug 06

Yeah, I thought of that too, which must be similar to how a manifest.xml
file is processed. The list  definition is the least amount of work to me.

Didn't find what you were looking for? Find more on Creating a List in a Configuration without a ListTemplate Or get search suggestion and latest updates.