<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > |
<html> <head> <TITLE>Customer detail page</TITLE> <META name="HandheldFriendly" content="True"> |
<!-- Demonstration of data driven master-detail page development with M-Business Client. Originally authored by John Karabaic and extended by Yadong Liu of iAnywhere Solutions. |
Copyright, 2004. iAnywhere Solutions. --> |
<script> |
var dbMgr = CreateObject("avantgo.db"); var dbset = null; |
function onloadHandler() { |
// Retrieve dbname and CustomerID. |
var dbname = avantgo.preferences.getStringValueForKey( "ListPage_dbname"); var id = avantgo.preferences.getStringValueForKey( "detailPage_"+dbname+"Id"); |
dbset = dbMgr.open(dbname, "r"); |
if(dbset == null) { alert("Could not open the '" + dbname + "' database."); return; } |
// Locate the customer record that matches CustomerID. |
var search = dbset.createSearch("CustomerID ==" + id); dbset.setFilter( search ); dbset.moveFirst(); |
// Bind customer data to detail page template. |
document.getElementById("customer_name") .firstChild.data = dbset.ContactName; document.getElementById("customer_title") .firstChild.data = dbset.ContactTitle; document.getElementById("customer_company") .firstChild.data = dbset.CompanyName; document.getElementById("customer_address") .firstChild.data = dbset.AddressLine1; document.getElementById("customer_city") .firstChild.data = dbset.City; |
document.getElementById("customer_zip") .firstChild.data = dbset.PostalCode; document.getElementById("customer_country") .firstChild.data = dbset.Country; document.getElementById("customer_phone") .firstChild.data = dbset.Phone; document.getElementById("customer_fax") .firstChild.data = dbset.Fax; |
} |
function onunloadHandler() { |
if( dbset ) dbset.close(); } |
</script> </head> |
<body onload="onloadHandler()" onunload="onunloadHandler()" bgcolor="#ffffff" style="margin-left:0px;margin-top:0px;" > |
<p><b>Sample Listviewer - Detail Page </b></p> |
<table width="224"> |
<tr style="background-color:#66cc99;"> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>Customer Name:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"> <span id="customer_name">_</span></td> |
<tr> |
<tr> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>Customer Title:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><span id="customer_title">_</span></td> |
<tr> |
<tr style="background-color:#66cc99;"> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>Company Name:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><span id="customer_company">_</span></td> |
<tr> |
<tr> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>Address:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><span id="customer_address">_</span></td> |
<tr> |
<tr style="background-color:#66cc99;"> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>City:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><span id="customer_city">_</span></td> |
<tr> |
<tr> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>Postal Code:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><span id="customer_zip">_</span></td> |
<tr> |
<tr style="background-color:#66cc99;"> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>Country:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><span id="customer_country">_</span></td> |
<tr> |
<tr> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>Phone:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><span id="customer_phone">_</span></td> |
<tr> |
<tr style="background-color:#66cc99;"> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><b>Fax:</b> </td> |
<td style="padding-right:1px;padding-left:1px; font-size:9px;padding-bottom:1px;color:#666666; padding-top:3px;" valign="top"><span id="customer_fax">_</span></td> |
<tr> |
</table> |
</body> </html> |
Send feedback about this page using email. | Copyright © 2008, iAnywhere Solutions, Inc. |