metero
Hi ,
i am trying to develop java application table , i would like to inform me if it is possible to create a table schema for lighstreamer table
with static and dynamic update data.
With javascript i create the table and i have to set the div elements for update data
with java table i need to have a table for a stocks and display some stock information's and to update some cells for the prices
using schema the table model is created with the columns for updates items it is possible to include and static data columns !!??
or mast found way to merge separate tables to a new one !!??
Thanks
Giuseppe Corti
Hi metero,
The Java SE Client library does not provide visual components (tables, etc.) as the JavaScript Client library instead does. Please can you clarify what you mean when you say "table model is created with the columns for updates items"? Did you refer to some of our demos? Or you refer to a third-party component?
metero
Hi , my approach was wrong , now i create a table and i pass static values to the cells ,
then i create two Maps holding the positions [item=index] and [fields = index]
so onUpdate i get the indexes and i know which cell to update on my model table
but actually now i have stack , what i want is on updated_cell to change the background foreground colors depends the old and new value
with DefaultTableCellRenderer i have only the new value of the cell on class
how i can get to DefaultTableCellRenderer the old and the new value of the item_field so to change the colors depends the prices !!??
i have try to change the
getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
to
getTableCellRendererComponent(table, OLDvalue,NEWvalue, isSelected, hasFocus, row, column);
but looks not working right
in demos the java client change the colors to yellow only for o while and its not depends by the old and new values
Thanks
Giuseppe Corti
Hi metero,
I think that you just need to customize a little the UpdateString class in order to store also the old value of a cell or replace the method isHot with a method that return the background color in accordance with your comparison of old and new values.
Hope That helps.
metero
Hi ,
i have change the UpdateString to
protected LSUpdateString(String newValue, String oldValue, boolean isHot)
and i have add the following checks
you have the first , i have add the second, is for date
if (newValue.indexOf(":") > -1 || newValue.indexOf("/") > -1)
and here the second check is for string of negative numbers
if (Character.isDigit(newValue.charAt(0)) || ((String) newValue).startsWith("-"))
what i am trying and i canot understand is how i can close the connection,
what i mean , i use the Swing_StockListDemo on my project ,
i have make some changes for compare new and old values and update the colors depends the prices
i have add static values for some columns ,like QTY portfolio ,
but i cant understand witch is the best way when i close the form to stop the feed , i have try the unsubscribe
SubscribedTableKey tableRef;
tableRef = client.subscribeTable(tInfo, this.table.getTableListener(), false);
client.unsubscribeTable(tableRef);
but as i can understand this only remove the items when i use client.closeConnection(); i get exception error
thanks
Giuseppe Corti
Hi metero,
To stop receiving feed from Lightstreamer server the unsubscribeTable/s is/are the correct methods to call, after that your client application will no longer receive any data from the server. I did not understand if you had different expectations.
Instead, closeConnection() method closes the network connection with the server if one is open, stopping any subscriptions still open. That you got an exception calling this method is not normal so, please can you post here the exception StackTrace?