Microsoft KB Archive/312098

= PRB: The Rendering of the ObjectList Control Varies on the Openwave UP.Simulator 4.1 Emulator =

Article ID: 312098

Article Last Modified on 6/14/2002

-

APPLIES TO


 * Microsoft Mobile Internet Toolkit 1.0

-



This article was previously published under Q312098



SYMPTOMS
The rendering of the ObjectList control varies on the Openwave UP.Simulator 4.1 Emulator. You have to use different markup to render the ObjectList control on the Openwave UP.Simulator 4.1 emulator depending on the value of the TableFields property.



RESOLUTION
To work around this behavior, use the following list of settings and markups for the ObjectList control when rendering on the Openwave UP.Simulator 4.1 emulator:
 * If you do not use the TableFields property of the ObjectList control, the UP.Simulator 4.1 emulator renders the ObjectList as a   tag with each item in the list as an   tag.
 * If you set the TableFields property of the ObjectList control to only one field, the UP.Simulator 4.1 emulator renders the ObjectList as a   tag with each item in the list as an   tag.
 * If the number of fields in the TableFields property of the ObjectList control results in a table that is too wide for the screen, the TableFields property is ignored and the ObjectList is rendered as a   tag with each item in the list as an   tag.



Steps to Reproduce the Behavior
The following code adds four items to the ObjectList control. To reproduce the behavior, uncomment each of the lines of code (separately) that set the TableFields property, and then run the page. The control generates different markup depending on which line you uncomment.

<%@ Register TagPrefix=&quot;mobile&quot; Namespace=&quot;System.Web.UI.MobileControls&quot; Assembly=&quot;System.Web.Mobile&quot; %> <%@ Page language=&quot;c#&quot; Inherits=&quot;System.Web.UI.MobileControls.MobilePage&quot; AutoEventWireup=&quot;true&quot; %>

       

void Page_Load(Object sender, EventArgs e) { if(!IsPostBack) {          //ObjectList1.TableFields=&quot;FN&quot;; //ObjectList1.TableFields=&quot;FN;LN&quot;; //ObjectList1.TableFields=&quot;FN;LN;A&quot;; ObjectList1.DataSource = CreateData; ObjectList1.DataBind; }  }

public ArrayList CreateData {   ArrayList arr = new ArrayList; arr.Add(new CustomDataObject(&quot;Nancy&quot;, &quot;Davilio&quot;, &quot;53&quot;)); arr.Add(new CustomDataObject(&quot;Andrew&quot;, &quot;Fuller&quot;, &quot;33&quot;)); arr.Add(new CustomDataObject(&quot;Anne&quot;, &quot;Dodsworth&quot;, &quot;32&quot;)); arr.Add(new CustomDataObject(&quot;Janet&quot;, &quot;Leverling&quot;, &quot;27&quot;));

return arr; }

public class CustomDataObject {   private String _strFirstName; private String _strLastName; private String _strAge;

public CustomDataObject(String strFirstName, String strLastName, String strAge) {       _strFirstName = strFirstName; _strLastName = strLastName; _strAge = strAge; }

public String FirstName {       get{return _strFirstName;} set{_strFirstName = value;} }

public String LastName {       get{return _strLastName;} }

public String Age {       get{return _strAge;} }

}//end class

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Keywords: kbwmldevice kbprb kbemulation kbpending kbservercontrols KB312098

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.