Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    74

    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.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    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

  1. Stock List .net Data Adapter
    By mIbrahim in forum Adapter APIs
    Replies: 1
    Last Post: May 3rd, 2013, 10:19 AM
  2. How to write my own stock list data adapter with java
    By pradeepgamage in forum General
    Replies: 1
    Last Post: January 9th, 2012, 12:39 PM
  3. Replies: 5
    Last Post: July 12th, 2010, 11:12 AM
  4. Stock List Adapter
    By minhphan200677 in forum Adapter APIs
    Replies: 1
    Last Post: April 14th, 2008, 10:26 AM
  5. Returning dynamic list of stockItems
    By rsouissi in forum Adapter APIs
    Replies: 7
    Last Post: December 11th, 2006, 10:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 04:51 AM.