Wss3sdk: How to customize the mobile List View and form page

Source: Internet
Author: User

This section provides an overview of the basic process for customizing the Windows SharePoint Services 3.0 List View and forms page accessed by mobile devices. Detailed steps participate in subsequent drillsArticle.

As described in the previous section on mobile page rendering mechanism, each control in the mobile homepage's header, content area, and footer (navigation area) results in a chain call, use the following three template selector controls to start the call.

    • Spmobilelisttitle-Select the renderingtemplate control used to render the header.

    • Spmobilelistcontents-Select the renderingtemplate control for the trunk part.

    • Spmobilelistnavigation-Select the renderingtemplate control for the footer.

One of these class objects selects an renderingtemplate object based on the current list type (such as notification or other custom list type) and page type.

These controls search for the renderingtemplate ID in the following format:

Mobile _ Listtypeid _ Pagetype _ Pagearea

WhereListtypeidIt can be the ID of the current list type (such as 105), or a value of the splisttemplatetype enumeration (such as contacts ). There are two ways to define a list type ID:

    • If the list is part of the website typeONET. xmlIfListtypeidThe value is in ONet. xml.ListElementTypeAttribute Value. The file is located in this directory:Local_drive:\ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ sitetemplates \Site_type\ XML

    • If the list is added to the website through the UI, that is, by creating a new (list) pageListtypeidID of the basic list type used as the new list type. This depends on the user's click on the create. ASPX page, which list type is clicked to enter the new page.

PagetypeYesView,Newform,Editform,DispformOrDeletepage.

PageareaYesTitle,ContentsOrNavigation.

If the ID of the renderingtemplate element specified by the current list type is not foundMobile_default _Pagetype_Pagearea.

To create a mobile list view or form page that contains a custom header (title), content body, or footer (navigation area), you only need to create a rendering template, its ID is the ID to be searched by the template selector control corresponding to the page area.

Existing renderingtemplate

After Windows SharePoint Services 3.0 is installed, the following two renderingtemplates for the mobile homepage already exist in mobiledefaulttemplates. ascx.

    • Mobile_comments_deletepage_navigation

    • Mobile_comments_view_navigation

    • Mobile_discussionboard_dispform_contents

    • Mobile_discussionboard_editform_contents

    • Mobile_discussionboard_editform_navigation

    • Mobile_discussionboard_newform_navigation

    • Mobile_documentlibrary_view_navigation

    • Mobile_events_dispform_navigation

    • Mobile_events_editform_navigation

    • Mobile_events_newform_navigation

    • Mobile_events_view_contents

    • Mobile_posts_deletepage_navigation

    • Mobile_webpagelibrary_dispform_contents

    • Mobile_webpagelibrary_dispform_navigation

You should not modify thisMobiledefatemplates. ascxFile. You can create a new renderingtemplate element (in your own. ascx file) only by using the same ID as an existing render control. However, this operation poses a risk and may damage other solutions deployed in WSS that depend on the original renderingtemplate object.

Note::

Rendering controls of Windows SharePoint Services 3.0 are loaded before custom controls. Therefore, when custom controls with the same ID exist, the loading of the control template overwrites the original controls. If there are two or more custom control templates with the same ID, the names listed in alphabetical order will overwrite all others. If the specified file contains two or more rendering templates with the same ID, they will not be loaded.

In addition, the following defaultRenderingtemplateObjects are also defined inMobiledefatemplates. ascxFile. If no rendering template defined for the current list type is found at runtime, these templates will be used. If you createRenderingtemplateThe risks mentioned above also exist when the object uses these IDs.

    • Mobile_default_deletepage_contents

    • Mobile_default_deletepage_navigation

    • Mobile_default_deletepage_title

    • Mobile_default_dispform_contents

    • Mobile_default_dispform_navigation

    • Mobile_default_dispform_title

    • Mobile_default_editform_contents

    • Mobile_default_editform_navigation

    • Mobile_default_editform_title

    • Mobile_default_newform_contents

    • Mobile_default_newform_navigation

    • Mobile_default_newform_title

    • Mobile_default_view_contents

    • Mobile_default_view_navigation

    • Mobile_default_view_title

You can nestRenderingtemplateObject. See the following example.

Custom mobile list view or part of a form
    1. In Microsoft Visual Studio, notepad, or any text editor, create a user control file (. ascx) and place it in the path\ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ controltemplates.

    2. Add several page tags to the file to register and reference the corresponding namespace.

    3. Add a rendering control to the. ascx file with the ID in this format:Mobile _Listtypeid_Pagetype_Pagearea.

      • ListtypeidIt can be the ID number of the current list type (such as 105), or a value of the splisttemplatetype enumeration (such as contacts)

      • PagetypeCan beView,Newform,Editform, DispformOrDeletepage

      • PageareaCan beTitle,ContentsOrNavigation

    4. Save the. ascx file and restart IIS to make the change take effect.

Example

The following example showsRenderingtemplateDefinition, with another nestedRenderingtemplate.

< SharePoint: renderingtemplate Runat = "Server" ID = "Mobile_104_view_navigation" >
  < Template >
  < Mobile: Link Runat = "Server" Text = "ASP. NET Website" Navigateurl = "Http://www.asp.net"   />
  < Mobile: Label Runat = "Server" Text = "" Breakafter = "True"   />
  < Spmobile: spmobilecomponent Runat = "Server" Templatename = "Mobile_default_view_navigation"   />
  </ Template >
</ SharePoint: renderingtemplate >
 
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.