Partilhar via


Mobile Views

Applies to: SharePoint Foundation 2010

A mobile view is a Standard SharePoint list view (not a Datasheet, or Gantt view) that is additionally designated as a mobile view.

You can designate a standard list view in a Schema.xml file as a mobile view by setting the MobileView attribute of the View element to TRUE. To specify that the mobile view is the default mobile view, set the MobileDefaultView attribute of the View element to TRUE. The following example shows the opening View element for a standard view that is designated as the default mobile view for a list.

<View BaseViewID="1" Type="HTML" WebPartZoneID="Main"
      DisplayName="$Resources:core,camlid4;" 
      DefaultView="TRUE" MobileView="True" 
      MobileDefaultView="True" Url="AllItems.aspx">

To modify these mobile settings on an existing list view, use the MobileView and MobileDefaultView properties of the Microsoft.SharePoint.SPView class.

The standard list views of many built in SharePoint list types are designated as mobile views by default in a new SharePoint Foundation deployment, including Announcements, Calendar, Tasks, and Shared Documents.

There are actually two versions of every mobile view:

  • The simple view shows just a single field from each item. By default this is the first mobile-supported field, usually the Title field, but users can set it to another field in the UI.

  • The detailed view shows the same fields, in the same order, that are defined to be visible on a computer browser.

The simple version of the view is the one that opens by default when users navigate to a list on a mobile device. When the simple version is open, the list view page (view.aspx) has a Details View link that will open the detailed version of the view. Similarly, when the detailed version is open, there is a Simple View link that will open the simple version.

The body section of a SharePoint Foundation mobile list view is created through Microsoft ASP.NET mobile controls, but metadata in a supporting SharePoint list schema determines some aspects of the detailed view, such as the fields and their order.

The items that are displayed in a mobile view are determined by the same filter definition that is defined for the standard view in the Schema.xml file that defines the list type. However, the number of items that can be displayed in the list view for a mobile device is affected by a rendering limit (see Ellipses and Rendering Limits).

Mobile View Selection List Control

The SharePoint mobile view selection list control is a control (SelectionList) that displays all the names of mobile views for the current list as drop-down options. It appears the mobile list view page (both the simple and detailed versions) if, and only if, there is more than one mobile view for the list.

The default choice in the view selector is the default mobile view. If a default mobile view is not defined, the first mobile view defined in the list schema (Schema.xml) is displayed as the default choice. Mobile view names are displayed in alphabetical order, except that the default mobile view is always the top option.

If the number of mobile views exceeds the maximum number of mobile views defined by the rendering limit for number of views (see Ellipses and Rendering Limits), the remaining mobile views are not represented in the control. The maximum number of characters per each choice option is also set by a rendering limit.

If no mobile view is defined for a list, the list will not appear on any list of lists on a mobile page. Users who enter the URL of such a list into the address box on their mobile browser will see an error page.