<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Lightstreamer :: Basic Stock-List Demo</title>
<link rel="stylesheet" type="text/css" href="css/table.css" />
<!-- load Lightstreamer libraries -->
<script src="ls/lscommons.js" type="text/javascript"></script>
<script src="ls/lspushpage.js" type="text/javascript"></script>
</head>
<body>
<table width="766" border="0">
<tr>
<td><a href="http://www.lightstreamer.com" target="_blank">
<img src="images/logo.gif" alt="LIGHTSTREAMER" hspace="0" border="0" /></a></td>
<td class="demoTitle">demo basic</td>
</tr>
</table>
<br />
<div id="test2">This is a test</div>
<div id="testnon">--</div>
<script type="text/javascript">
//////////////// Master Push-Page Configuration
var pushPage = new PushPage();
pushPage.context.setDebugAlertsOnClientError(true) ; // (set false in production)
pushPage.context.setDomain()// (set the domain when deploying on web server)
pushPage.onEngineCreation = function(lsEngine) {
lsEngine.context.setDebugAlertsOnClientError(true) ; // (set false in production)
lsEngine.connection.setLSHost(null); // (set the hostname when deploying on web server)
lsEngine.connection.setLSPort(null); // (set the port when deploying on web server)
lsEngine.connection.setAdapterName("MY_REAL_TIME") ;
//lsEngine.policy.setMaxBandwidth(40); // ignored in Moderato and Allegro editions
lsEngine.changeStatus("STREAMING");
};
pushPage.bind();
pushPage.createEngine("MyCommonEngine", "ls/", "SHARE_SESSION", true);
// both group and schema need to be defined by the backend
var nvTable = new NonVisualTable("a","b","MERGE");
nvTable.setSnapshotRequired(true);
nvTable.setRequestedMaxFrequency(1.0);
nvTable.setDataAdapter("DEMO");
pushPage.addTable(nvTable , "nlist");
nvTable.onItemUpdate = function(itemIndex,update,itemName) {
document.getElementById("testnon").innerHTML =update.getNewValue("last_price");
}
</script></body></html>
Bookmarks