Hi,
@saleem145, Wrote: 1. Where do I download the advanced TIBCO GI DEMO??
The code is not available yet. It will be probably available soon.
@saleem145, Wrote: 2. How do I change the simple demo to use the dot net adapter??
The .NET StocklistDemo adapter publishes the same items and fields as the java one. You just have to be sure that the demo points to the correct adapter.
So the id of the adapters_conf element inside the adapters.xml file of the adapter (under LS_HOME/adapters/AdapterName/) have to be equal to the string used to call the
setAdapter javascript method (on the lslogic.js file).
@saleem145, Wrote: 3. Please could you give me an overview of the four javascript files in the TIBCO GI Demo (simple)??
- lscommons.js and lspushpage.js are part of Lightstreamer web client library so you should not worry about those files.
- lslogic.js contains basic lightstreamer logic: PushPage instantiation, LightstreamerEngine configuration (lsPage.onEngineCreation) and table subscription.
The LS_startPush method is called on the onload event by the GI runtime. It creates the OverwriteTable that will feed the "numeric" tables.
The LS_onDialog method is called whenever a "popup" is created. It creates the ChartTable that will feed that popup
- logic.js contains various tables' event handlers and the logic that handles the creation of "popups" (you can see a rough division on the file itself)
@saleem145, Wrote: 4. I would like to add more items and fields to the simple demo -- what changes do I need to make specially in the front end??
The available fields are already subscribed, so to enlarge the schema you have to modify the adapter to let it publish more fields.
You can add more items in 3 steps
On lslogic.js enlarge the subscribed item/fields:
[syntax="JS"]
var newTable = new OverwriteTable("item1 item2 item3 item4 item5", schema, "MERGE");[/syntax]
could become [syntax="JS"]
var newTable = new OverwriteTable("item1 item2 item3 item4 item5 item6 item7 item8", schema, "MERGE");[/syntax]
Enlarge Lightstreamer Table view:
in appcanvas.xml search for
[syntax="XML"]<object type="jsx3.gui.Block">
<variants jsxoverflow="1"/>
<strings jsxheight="100%" jsxname="block" jsxwidth="100%" jsxtext="<table cellspacing="0" cellpadding="2" width="790" border="0" > <tr class="tabletitle"> <td width="148" style="text-align: left"> Name</td> <td width="42">Last</td> <td width="64" style="text-align: center">Time</td> <td width="24" style="text-align: center">+/-</td> <td width="61">Change(%)</td> <td width="50">Bid Size</td> <td width="50">Bid</td> <td width="50">Ask</td> <td width="50">Ask Size</td> <td width="50">Min</td> <td width="50">Max</td> <td width="50">Ref.</td> <td width="50">Open</td> </tr> <tr class="lscoldA"> <td nowrap style="text-align: left"> <a href="#" onClick="sfn.launchDetailDialog(1)"> <div class="stocknameA" source="lightstreamer" table="1" item="1" field="12">Loading...</div> </a> </td> <td><div source="lightstreamer" table="1" item="1" field="1">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="2">-</div></td> <td><span source="lightstreamer" table="1" item="1" field="13"><img src="JSXAPPS/GIDemo/images/spacer_4px.gif" width="20" height="8" border="0"></span></td> <td nowrap><div source="lightstreamer" table="1" item="1" field="3">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="4">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="5">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="6">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="7">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="8">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="9">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="10">-</div></td> <td><div source="lightstreamer" table="1" item="1" field="11">-</div></td> </tr> <tr class="lscoldB"> <td nowrap style="text-align: left"> <a href="#" onClick="sfn.launchDetailDialog(2)"> <div class="stocknameB" source="lightstreamer" table="1" item="2" field="12">Loading...</div> </a> </td> <td><div source="lightstreamer" table="1" item="2" field="1">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="2">-</div></td> <td><span source="lightstreamer" table="1" item="2" field="13"><img src="JSXAPPS/GIDemo/images/spacer_4px.gif" width="20" height="8" border="0"></span></td> <td nowrap><div source="lightstreamer" table="1" item="2" field="3">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="4">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="5">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="6">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="7">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="8">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="9">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="10">-</div></td> <td><div source="lightstreamer" table="1" item="2" field="11">-</div></td> </tr> <tr class="lscoldA"> <td nowrap style="text-align: left"> <a href="#" onClick="sfn.launchDetailDialog(3)"> <div class="stocknameA" source="lightstreamer" table="1" item="3" field="12">Loading...</div> </a> </td> <td><div source="lightstreamer" table="1" item="3" field="1">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="2">-</div></td> <td><span source="lightstreamer" table="1" item="3" field="13"><img src="JSXAPPS/GIDemo/images/spacer_4px.gif" width="20" height="8" border="0"></span></td> <td nowrap><div source="lightstreamer" table="1" item="3" field="3">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="4">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="5">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="6">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="7">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="8">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="9">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="10">-</div></td> <td><div source="lightstreamer" table="1" item="3" field="11">-</div></td> </tr> <tr class="lscoldB"> <td nowrap style="text-align: left"> <a href="#" onClick="sfn.launchDetailDialog(4)"> <div class="stocknameB" source="lightstreamer" table="1" item="4" field="12">Loading...</div> </a> </td> <td><div source="lightstreamer" table="1" item="4" field="1">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="2">-</div></td> <td><span source="lightstreamer" table="1" item="4" field="13"><img src="JSXAPPS/GIDemo/images/spacer_4px.gif" width="20" height="8" border="0"></span></td> <td nowrap><div source="lightstreamer" table="1" item="4" field="3">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="4">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="5">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="6">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="7">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="8">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="9">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="10">-</div></td> <td><div source="lightstreamer" table="1" item="4" field="11">-</div></td> </tr> <tr class="lscoldA"> <td nowrap style="text-align: left"> <a href="#" onClick="sfn.launchDetailDialog(5)"> <div class="stocknameA" source="lightstreamer" table="1" item="5" field="12">Loading...</div> </a> </td> <td><div source="lightstreamer" table="1" item="5" field="1">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="2">-</div></td> <td><span source="lightstreamer" table="1" item="5" field="13"><img src="JSXAPPS/GIDemo/images/spacer_4px.gif" width="20" height="8" border="0"></span></td> <td nowrap><div source="lightstreamer" table="1" item="5" field="3">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="4">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="5">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="6">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="7">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="8">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="9">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="10">-</div></td> <td><div source="lightstreamer" table="1" item="5" field="11">-</div></td> </tr> </table>"/>
</object>
[/syntax]
and modify the jsxtext value of the strings element adding more lines. I know it's a little bit cryptic, but what you are seeing is just an html table so you just have to add a tr element equals to the others except for the item value of the div elements
[syntax=HTML]
<td><div source="lightstreamer" table="1" item="6" field="7">-</div></td>
[/syntax]
Finally enlarge GI table view by enlarging the height of the element in order to have enough space to show all the subscribed items. You have to enlarge the height of the block that contains the matrix:
[syntax="XML"]<object type="jsx3.gui.Block">
<variants jsxwidth="795" jsxheight="500" jsxoverflow="2"/>
<strings jsxname="pane"/>
<dynamics jsxborder="@No jsxborder"/>
<object type="jsx3.gui.Matrix">[/syntax]
Hope that helps