06 July 2009

SharePoint Forms for Lists and Libraries

WSS 3.0 and MOSS uses following forms  to display the list items is different modes:

 

AllItems.aspx

This form display the items in list format.

image

DispForm.aspx

This form displays the details of the details for the item.

image

EditForm.aspx

This form is used to edit items.

image

Field Type Definition: A field type definition is an XML file named on the pattern fldtypes*.xml that is deployed to the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML. To see the schema for this file visit this site. Some of the important attributes in the schema are:

FieldEditorUserControl Represents the relative path to a field_type FieldEditor.ascx file that defines a control that appears, in Windows SharePoint Services 3.0, in the Additional Column Settings section on the New Site Column page. The control enables column creators to set, for a particular column, the variable properties of the field type.
FieldTypeClass Represents the strong name of the field type class library. "FieldTypeClass" includes the class name and assembly name with Version, Culture, and PublicKeyToken.
PropertySchema This plays a vital role in making a site column more adjustable. While creating a column based on a field type you might want to set certain property for the column. Common scenario for this can be: custom validation string, formatting or specifying lookups.
RenderPattern Defines the actual Collaborative Application Markup Language (CAML), HTML, and script that Windows SharePoint Services 3.0 can use, as an alternative to a rendering template control (.ascx file), to render the field type in the UI. Also, in list views, this element renders the column headers, based on the selected field type

TypeShortDescription

Display the text in “Name and Type” section while creating a new column or on the /_layouts/fldNew.aspx page.

eg: <Field Name="TypeShortDescription">Telephone</Field>

image

TypeDisplayName

Text to display in the type column on he list edit page (listedit.aspx).

eg:

<Field Name="TypeDisplayName">Telephone 1</Field>

image

 

 

SPFieldTypeDefinition: This field type definition can be accessed in the Windows SharePoint Services 3.0 object model as an SPFieldTypeDefinition object. SPFieldTypeDefinition is available as a property of SPField class. SPField class is the base class for any wss 3.0 columns (field types).

Custom Field Editor

In order to create a custom field editor you will have to create a usercontrol (ascx) that inherits from usercontrols and implements IFieldEditor interface. When a class inherits from the UserControl and implements this interface, class assists in the rendering of a field property editor control on a new column creation page or a column edit page, which in Windows SharePoint Services 3.0 are the New Site Column, Change Site Column, Create Column, and Change Column pages.

IFieldEditor Members:

DisplayAsNewSection Gets a value that indicates whether the field property editor should be in a special section on the page.
InitializeWithField Initializes the field property editor when the page loads.
OnSaveChange Validates and saves the changes the user has made in the field property editor control.