R
Rich
I have an ObjectList which I am populating from a SQL Server database (a join
accross several tables). I have customized the ObjectList display with
ItemTemplate and Alternating ItemTemplate, and pass CommandName to the
ItemCommand message handler so that the user can either drill into the item
details or perform a followon task associated with the item. When I use the
default item details display all is well. However, I would like to customize
the item details display just as I have customized the parent item display. I
tried to closely follow the example in Wigley/Roxburgh's "Building Microsoft
ASP.NET Applications for Mobile Devices", but the customized item details
page does not contain my data (although a "view source" in IE6 shows that the
"<br />" tags in my ItemDetailsTemplate did get passed to the details page).
Any idea why I am not getting the "meat" of my data
(start;lastname;firstname;name)?
Here is part of the code from the aspx page:
<mobile:ObjectList id="olstTask" runat="server" ItemsPerPage="5"
CommandStyle-StyleReference="subcommand" LabelStyle-StyleReference="title"
Font-Size="Small" TableFields="start;lastname;firstname;name">
<Field Title="Due" DataFormatString="{0:MM/d h:mm}"
DataField="start"></Field>
<Field Title="Patient" DataField="lastname"></Field>
<Field DataField="firstname"></Field>
<Field Title="Task" DataField="name"></Field>
<DeviceSpecific>
<Choice Filter="isHTML32"
Xmlns="http://schemas.microsoft.com/mobile/html32template">
<HeaderTemplate>
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="0">
<TR>
<TD><IMG alt="Sea State 1" src="ss1_logo.png"></TD>
</TR>
</HeaderTemplate>
<ItemTemplate>
<TR>
<TD><asp:LinkButton ID="lbnStart" CommandName="doTask" Runat="server">
<%# ((ObjectListItem)Container)["start"] %></asp:LinkButton>
</TD>
<TD><%# ((ObjectListItem)Container)["lastname"] %></TD>
<TD><%# ((ObjectListItem)Container)["firstname"] %></TD>
<TD><asp:LinkButton ID="lbnTask" CommandName="details" Runat="server">
<%# ((ObjectListItem)Container)["name"] %></asp:LinkButton></TD>
</TR>
</ItemTemplate>
<AlternatingItemTemplate>
<TR bgcolor="#ccffcc">
<TD>
<asp:LinkButton ID="lbnStart_alt" CommandName="doTask" Runat="server">
<%# ((ObjectListItem)Container)["start"] %>
</asp:LinkButton>
</TD>
<TD><%# ((ObjectListItem)Container)["lastname"] %></TD>
<TD><%# ((ObjectListItem)Container)["firstname"] %></TD>
<TD>
<asp:LinkButton ID="lbnTask_alt" CommandName="details" Runat="server">
<%# ((ObjectListItem)Container)["name"] %>
</asp:LinkButton>
</TD>
</TR>
</AlternatingItemTemplate>
<ItemDetailsTemplate>
<%#
DataBinder.Eval(((ObjectList)Container.NamingContainer).Selection.DataItem,
"start", "Due to start: {0}") %>
<br/>
<%#
DataBinder.Eval(((ObjectList)Container.NamingContainer).Selection.DataItem,
"firstname", "Patient name: {0}") %>
<%#
DataBinder.Eval(((ObjectList)Container.NamingContainer).Selection.DataItem,
"lastname", " {0}") %>
<br/>
<%#
DataBinder.Eval(((ObjectList)Container.NamingContainer).Selection.DataItem,
"name", "Task: {0}") %>
</ItemDetailsTemplate>
<FooterTemplate>
</TABLE>
</FooterTemplate>
</Choice>
</DeviceSpecific>
</mobile:ObjectList>
accross several tables). I have customized the ObjectList display with
ItemTemplate and Alternating ItemTemplate, and pass CommandName to the
ItemCommand message handler so that the user can either drill into the item
details or perform a followon task associated with the item. When I use the
default item details display all is well. However, I would like to customize
the item details display just as I have customized the parent item display. I
tried to closely follow the example in Wigley/Roxburgh's "Building Microsoft
ASP.NET Applications for Mobile Devices", but the customized item details
page does not contain my data (although a "view source" in IE6 shows that the
"<br />" tags in my ItemDetailsTemplate did get passed to the details page).
Any idea why I am not getting the "meat" of my data
(start;lastname;firstname;name)?
Here is part of the code from the aspx page:
<mobile:ObjectList id="olstTask" runat="server" ItemsPerPage="5"
CommandStyle-StyleReference="subcommand" LabelStyle-StyleReference="title"
Font-Size="Small" TableFields="start;lastname;firstname;name">
<Field Title="Due" DataFormatString="{0:MM/d h:mm}"
DataField="start"></Field>
<Field Title="Patient" DataField="lastname"></Field>
<Field DataField="firstname"></Field>
<Field Title="Task" DataField="name"></Field>
<DeviceSpecific>
<Choice Filter="isHTML32"
Xmlns="http://schemas.microsoft.com/mobile/html32template">
<HeaderTemplate>
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="0">
<TR>
<TD><IMG alt="Sea State 1" src="ss1_logo.png"></TD>
</TR>
</HeaderTemplate>
<ItemTemplate>
<TR>
<TD><asp:LinkButton ID="lbnStart" CommandName="doTask" Runat="server">
<%# ((ObjectListItem)Container)["start"] %></asp:LinkButton>
</TD>
<TD><%# ((ObjectListItem)Container)["lastname"] %></TD>
<TD><%# ((ObjectListItem)Container)["firstname"] %></TD>
<TD><asp:LinkButton ID="lbnTask" CommandName="details" Runat="server">
<%# ((ObjectListItem)Container)["name"] %></asp:LinkButton></TD>
</TR>
</ItemTemplate>
<AlternatingItemTemplate>
<TR bgcolor="#ccffcc">
<TD>
<asp:LinkButton ID="lbnStart_alt" CommandName="doTask" Runat="server">
<%# ((ObjectListItem)Container)["start"] %>
</asp:LinkButton>
</TD>
<TD><%# ((ObjectListItem)Container)["lastname"] %></TD>
<TD><%# ((ObjectListItem)Container)["firstname"] %></TD>
<TD>
<asp:LinkButton ID="lbnTask_alt" CommandName="details" Runat="server">
<%# ((ObjectListItem)Container)["name"] %>
</asp:LinkButton>
</TD>
</TR>
</AlternatingItemTemplate>
<ItemDetailsTemplate>
<%#
DataBinder.Eval(((ObjectList)Container.NamingContainer).Selection.DataItem,
"start", "Due to start: {0}") %>
<br/>
<%#
DataBinder.Eval(((ObjectList)Container.NamingContainer).Selection.DataItem,
"firstname", "Patient name: {0}") %>
<%#
DataBinder.Eval(((ObjectList)Container.NamingContainer).Selection.DataItem,
"lastname", " {0}") %>
<br/>
<%#
DataBinder.Eval(((ObjectList)Container.NamingContainer).Selection.DataItem,
"name", "Task: {0}") %>
</ItemDetailsTemplate>
<FooterTemplate>
</TABLE>
</FooterTemplate>
</Choice>
</DeviceSpecific>
</mobile:ObjectList>