AttendeeField Class
Represents a field control for an Attendee e-mail address.
System.Object
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.TemplateBasedControl
Microsoft.SharePoint.WebControls.FormComponent
Microsoft.SharePoint.WebControls.FieldMetadata
Microsoft.SharePoint.WebControls.BaseFieldControl
Microsoft.SharePoint.WebControls.AttendeeField
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.TemplateBasedControl
Microsoft.SharePoint.WebControls.FormComponent
Microsoft.SharePoint.WebControls.FieldMetadata
Microsoft.SharePoint.WebControls.BaseFieldControl
Microsoft.SharePoint.WebControls.AttendeeField
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
AttendeeField
Description
The Microsoft.SharePoint.WebControls.AttendeeField class inherits from the Microsoft.SharePoint.WebControls.BaseFieldControl which is the base class for SharePoint field representation. The AttendeeField is accountable for presenting a field control that allows ease of lookup for users, or in this case "Attendees". To do this, it leverages the PeopleEditor object (or what is commonly known as the “People Picker”) in order to facilitate the searching and validation of legitimate users.
Firstly, the control is going to go through pragmatic checking regarding the field, whether the field value is cached and whether the SPControlMode is out of display mode. Following, a FindControl method will create through casting a new PeopleEditor object, ensuring that it is not null. Within the overrideen base Value object, the PeopleEditor will test whether the page is a postback in which case the validation events are called. If not an ArrayList will act as storage for the PeopleEditor.ResolvedEntitiesPickerEntity objects. All the users are checked as to whether they have an email address from PeopleEditor.PeopleInfo.Email property as well. The PickerEntity value are returned as the value for the field.
The Usage Scenario
You typically find the use of AttendeeField to be used through the SharePoint interface when adding fields to a SharePoint list or defaulted creation on several Meeting template sites.
In the below, we are finding a Control by it’s ID, and testing whether it is of type BaseFieldControl. Once we have determined that it is of BaseFieldControl, we will test whether it is of AttendeeField type. If it is an AttendeeField, we are going to get the field Value (which is a PickerEntity.Key) and cast it to a string. We could use this value in other segments of code following if promoted to a global variable.
C# Code Example
Control ctrl = FindControl("ControlID");
if (ctrl is BaseFieldControl)
{
BaseFieldControl tempCtrl = (BaseFieldControl) ctrl;
if (tempCtrl is AttendeeField)
{
string attendeeEntityKey = tempCtrl.Value.ToString();
}
}
Visual Basic .NET Code Example
Dim ctrl As Control = FindControl("ControlID")
If TypeOf ctrl Is BaseFieldControl Then
Dim tempCtrl As BaseFieldControl = DirectCast(ctrl, BaseFieldControl)
If TypeOf tempCtrl Is AttendeeField Then
Dim attendeeEntityKey As String = tempCtrl.Value.ToString()
End If
End If
The Microsoft.SharePoint.WebControls.AttendeeField class inherits from the Microsoft.SharePoint.WebControls.BaseFieldControl which is the base class for SharePoint field representation. The AttendeeField is accountable for presenting a field control that allows ease of lookup for users, or in this case "Attendees". To do this, it leverages the PeopleEditor object (or what is commonly known as the “People Picker”) in order to facilitate the searching and validation of legitimate users.
Firstly, the control is going to go through pragmatic checking regarding the field, whether the field value is cached and whether the SPControlMode is out of display mode. Following, a FindControl method will create through casting a new PeopleEditor object, ensuring that it is not null. Within the overrideen base Value object, the PeopleEditor will test whether the page is a postback in which case the validation events are called. If not an ArrayList will act as storage for the PeopleEditor.ResolvedEntitiesPickerEntity objects. All the users are checked as to whether they have an email address from PeopleEditor.PeopleInfo.Email property as well. The PickerEntity value are returned as the value for the field.
The Usage Scenario
You typically find the use of AttendeeField to be used through the SharePoint interface when adding fields to a SharePoint list or defaulted creation on several Meeting template sites.
In the below, we are finding a Control by it’s ID, and testing whether it is of type BaseFieldControl. Once we have determined that it is of BaseFieldControl, we will test whether it is of AttendeeField type. If it is an AttendeeField, we are going to get the field Value (which is a PickerEntity.Key) and cast it to a string. We could use this value in other segments of code following if promoted to a global variable.
C# Code Example
Control ctrl = FindControl("ControlID");
if (ctrl is BaseFieldControl)
{
BaseFieldControl tempCtrl = (BaseFieldControl) ctrl;
if (tempCtrl is AttendeeField)
{
string attendeeEntityKey = tempCtrl.Value.ToString();
}
}
Visual Basic .NET Code Example
Dim ctrl As Control = FindControl("ControlID")
If TypeOf ctrl Is BaseFieldControl Then
Dim tempCtrl As BaseFieldControl = DirectCast(ctrl, BaseFieldControl)
If TypeOf tempCtrl Is AttendeeField Then
Dim attendeeEntityKey As String = tempCtrl.Value.ToString()
End If
End If
- 6/3/2010
- Adam Buenz - MVP