Wss3sdk: walkthrough-customize the list item title in the Mobile Display form

Source: Internet
Author: User

This walkthrough will show you how to customize the rendering of fields on the mobile page by implementing a custom renderingtemplate control. The example shows how to customize the display of the title field of the notification list item on the Mobile Display page.

As described in the previous section on mobile page rendering mechanism,Microsoft. Sharepoint. mobilecontrols. spmobilelistfieldselectorThe template selector control is called, and a chain is called to find the control displayed on the page.

Based on the current list type and field (such as the notification and title in this example), this object determines whichRenderingtemplateThis field is used to render the field on the Mobile Display page.

Search for this controlRenderingtemplateObject NameMobilecustomlistfield _Listtypeid_Fieldtype_Field, WhereListtypeidIt can be the ID of the current list type (such as 105), or a value of the splisttemplatetype enumeration (such as contacts ).FieldtypeIs the Data Type of the field. For example, text or number.FieldIs the internal name of the field, such as workphone. If this ID does not existMobiledefalistlistfieldOfRenderingtemplateObject.

WSS 3.0 does not have the built-in IDMobilecustomlistfield_announcements_text_titleOfRenderingtemplate. In this drill, you will create a new template for the list item title field of the notification list to replace the default template.

Custom notification item title:
  1. In the text editor, create a text file (UTF-8) named announcementsitemdisplaypagetitlefield. ascx. Stored in local_drive: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ controltemplatesDirectory.

  2. Add the following points to the tag to the file:

    < % @ Control Language = "C #" % >
    < % @ Assembly Name = "Microsoft. Sharepoint, version = 12.0.0.0, culture = neutral, publickeytoken = 71e9bce111e9429c" % >
    < % @ Register
    Tagprefix = "Mobile" Namespace = "System. Web. UI. mobilecontrols" Assembly = "System. Web. Mobile, version = 1.0.3300.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a" % >
    < % @ Register
    Tagprefix = "SharePoint" Namespace = "Microsoft. Sharepoint. webcontrols" Assembly = "Microsoft. Sharepoint, version = 12.0.0.0, culture = neutral, publickeytoken = 71e9bce111e9429c" % >
    < % @ Register
    Tagprefix = "Spmobile" Namespace = "Microsoft. Sharepoint. mobilecontrols" Assembly = "Microsoft. Sharepoint, version = 12.0.0.0, culture = neutral, publickeytoken = 71e9bce111e9429c" % >
    < % @ Import Namespace = "Microsoft. SharePoint" % >

  3. Then, addRenderingtemplateObject, set its ID to displaySpmobilewebtitleObject ID:Mobilecustomlistfield_announcements_text_title.

    < SharePoint: renderingtemplate Runat = "Server" ID = "Mobilecustomlistfield_announcements_text_title"   >
    </ SharePoint: renderingtemplate >
  4. InRenderingtemplateDefineTemplateElement to containLabelChild widget. Set the label attributes as follows:

    < Template >
    < Mobile: Label Text = "Title field in announcements list" Runat = "Server"   />
    </ Template >
  5. Save and close the file.

  6. ReSTART Internet Information Services (IIS ). You can use the iisreset command in the command line to restart IIS.

  7. If you are using a device simulator on your computer, rather than a real mobile device, you may also need to delete Temporary Internet Files.

  8. Navigate to a notification list from your device or simulator. Click a notification to go to its display page. You will see the newly customized title, as shown on the screen below:

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.