Ellipses and Rendering Limits
Applies to: SharePoint Foundation 2010
SharePoint Foundation displays an ellipsis in the mobile device viewer when the text length of a field exceeds a limit that is set in the mobile web.config file (located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS\MOBILE). In mobile Edit forms for items containing large amounts of data, SharePoint Foundation disables field editing per field type to avoid data loss when the contents exceed a specified limit. In both cases, mobile rendering limits determine what is displayed in the mobile device.
Rendering limits define not only text length limits for ellipsis rendering used in mobile controls, but also the number of options displayed in the controls. For a list of the rendering limits and their default values, see the table at the end of this topic.
Two Ways to Configure Limits
Rendering limits are determined in one of two ways:
Farm wide default limits are set in the mobile web.config file, which can be edited.
The default limits can be overridden programmatically on a per Web site basis through the Properties property of the SPWeb. Modifications you make through Web properties are not inherited by subsites.
Modifying the Mobile Web.config File
Each limit setting in the mobile web.config is represented as a key-and-value pair within the <appSettings> section of the fileāfor example, <add key="mobile_webtitlelimit" value="20" />. If the configuration for a text length limitation is set to 0 or no entry is specified, ellipsis rendering is turned off for that key.
Note
When you modify the mobile web.config file, you must do so on each front-end Web server in a SharePoint Foundation deployment.
Overriding Defaults per Web Site with the Object Model
To allow customization of rendering limits per Web site, SharePoint Foundation first determines whether the property bag (the Properties property) of the SPWeb object stores the rendering limit parameter. If so, the value stored by the property bag specifies the rendering limit; otherwise, the value stored in web.config specifies the rendering limit. Hence, property bag settings for a particular site override the farm settings in the mobile web.config.
To change the rendering limit for a mobile control, add a property to the property bag (SPPropertyBag) object in the Properties property. The following example shows how to change the rendering limit for list titles of a specific Web site to 256 characters.
SPWeb webSite = SPContext.Current.Site.AllWebs["MyWebSite"];
webSite.Properties["mobile_listtitlelimit"] = "256";
webSite.Properties.Update();
Dim webSite As SPWeb = SPContext.Current.Site.AllWebs("MyWebSite")
webSite.Properties("mobile_listtitlelimit") = "256"
webSite.Properties.Update()
The example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint and Microsoft.SharePoint.Utilities namespaces.
Rendering Limits
The following table describes the rendering limit parameters used in mobile pages and shows their default maximum values. The unit of measure is character, regardless of half-width or full-width character.
Name |
Description |
Value |
---|---|---|
Base Rendering Limit |
|
|
mobile_basetextlengthlimit |
Base limit for text length |
1024 |
System Rendering Limits |
|
|
mobile_peoplesearchresultlimit |
Limit for number of items returned in a people search |
50 |
mobile_maximumimagesize_kilobyte |
Size limit for images in Kbytes |
100 |
mobile_enablelimitationondispform |
Flag for ellipsis rendering on Display form |
FALSE |
mobile_fieldnumberlimitforinputform |
Limit for the number of fields to show on New and Edit forms |
100 |
mobile_fieldtitlelimit |
Limit for the title of each field on forms |
1024 |
mobile_itemtitlelimit |
Limit for the item title shown on forms |
1024 |
mobile_listtitlelimit |
Limit for the List title on list views |
1024 |
mobile_viewitemnumberlimit |
Limit for the number of items to show on list views |
1000 |
mobile_viewnumberlimit |
Limit for the number of Views to show in the View drop down list |
20 |
mobile_viewtitlelimit |
Limit for the length of View names in the for View drop down selector |
1024 |
mobile_webtitlelimit |
Limit for the length of the Web site title shown on the top page of the Web site |
1024 |
Field Related Limits |
|
|
mobile_attachmentsfieldnumberlimit |
Limit for the number of attachments to show |
20 |
mobile_attachmentsfieldtextlimit |
Limit for the file name of an individual attachment |
1024 |
mobile_calculatedfieldtextlimit |
Limit for field value length for Calculated field |
1024 |
mobile_choicefieldoptionnumberlimit |
Limit for the number of options to show on the New and Edit forms for a Choice field |
20 |
mobile_choicefieldoptiontextlimit |
Limit for the name of any individual on the New and Edit forms for a Choice field |
1024 |
mobile_fieldtextlimitforview |
Limit for the length of any individual field value on list views |
1024 |
mobile_filefieldtextlimit |
Limit for the field value length for File fields |
1024 |
mobile_lookupfieldoptionnumberlimit |
Limit for the number of options to show on the New and Edit forms for a Lookup field |
20 |
mobile_lookupfieldoptiontextlimit |
Limit for the name of any individual option on the New and Edit forms for a Lookup field |
1024 |
mobile_multichoice_displaylimitforselectedchoices |
Limit for the number of selected choices, in a multi choice field, to show in list views and item Display forms |
20 |
mobile_multilinetextfieldtextlimit |
Limit for the field value length for text fields with multiple lines |
2048 |
mobile_multilookup_displaylimitforselectedlookups |
Limit for the number of selected lookup values, in a multi value lookup field, to show in list views and item Display forms |
20 |
mobile_multiuser_displaylimitforselectedusers |
Limit for the number of selected users, in a multi user field, to show in list views and item Display forms |
100 |
mobile_singlelinetextfieldtextlimit |
Limit for the field value length for single line text fields |
1024 |
mobile_urlfieldtextlimit |
Limit for the length of the text for a URL field (the URL itself is not shown and not truncated) |
1024 |
mobile_userfieldoptionnumberlimit |
Limit for the number of options to show on New / Edit form for a user field |
20 |
mobile_userfieldoptiontextlimit |
Limit for the length of any individual option for a user field |
1024 |