-
February 13th, 2017, 09:47 AM
#1
Creating adapter for dynamic stock list
In my case my server create adapter list as dynamic. For example some times list contain 4 stocks in some times 2 stocks or in some times stock list will be empty and that time need to show the market closed message.
I have created external feedsimulater class like bellow datastructure,(Remote adapter)
public class RateRow {
private String itemName;
private String instrumentName;
private String bidRate;
private String askRate;
private String low_price;
private String high_price;
}
And i have assigned the values to this class. Finally for every 500 millisecond it will assign the values to this class.And my array list look like
private final ArrayList<RateRow> bidaskrates = new ArrayList<RateRow>();
Now i need to show this list to client browser. Whenever the changes happens in arraylist it should be reflect in user browser.
Now i created my RateRow class with itemName property. This itemName manually created like item1,item2 etc upto my stocklist. Now can i create some static 30 item names(like item1,item2 ... item30) in client and while subscription using MERGE mode can i compare with server stock items and display in client browser only available stocks in server. If supose server contain 4 items means i need to display only 4 items in client.
-
February 14th, 2017, 09:22 AM
#2
The normal way available for displaying a list on the client browser is using a single item in COMMAND mode, which represent the whole list.
The item carries the changes in the list, so your Adapter should send to the client suitable update events specifying
- if a new line with certain values has to be added,
- if a line has to be deleted,
- or if a line has to be updated with certain values.
This is well demonstrated by our Portfolio Demo, where the list shown may change based on external buy and sell operations.
Please see the description here, and focus on the "Basic Portfolio Demo", which is the simplest version and the most similar to your case, where the whole content of the table is available in the Data Adapter as a single array. The Adapter side of the Basic Portfolio Demo is shown here.
Similar Threads
-
By mIbrahim in forum Adapter SDKs
Replies: 1
Last Post: May 3rd, 2013, 09:19 AM
-
By pradeepgamage in forum General
Replies: 1
Last Post: January 9th, 2012, 11:39 AM
-
By spganesh in forum Client SDKs
Replies: 5
Last Post: July 12th, 2010, 10:12 AM
-
By minhphan200677 in forum Adapter SDKs
Replies: 1
Last Post: April 14th, 2008, 09:26 AM
-
By rsouissi in forum Adapter SDKs
Replies: 7
Last Post: December 11th, 2006, 09:26 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 05:35 PM.
Bookmarks