Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Aug 2009
    Location
    Binh Duong
    Posts
    14

    problem with number of stock name

    hello everybody,
    I have a problem with javascript. I don't know how to get the number of stock name. I want to generate automatically name stock. Ex: I have x stock name. and i want to display x stock name. But i can't do it. Please help me!

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,017
    I'm not sure I understand the question properly.
    May you please expand it and provide an example of the information you own, the one you get from Lightstreamer and the one you would like to display?

  3. #3
    Member
    Join Date
    Aug 2009
    Location
    Binh Duong
    Posts
    14
    EX: I have 100 stock name from Database and I use Adapter to post to server. In web client, how to get number of stock name to write in html. Thank you so much!

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    518
    Sorry, but we can't really understand what you mean. What is the "number of stock name"?

  5. #5
    Member
    Join Date
    Aug 2009
    Location
    Binh Duong
    Posts
    14
    for (var i = 1; i <= 10; i++) {
    var suff = (i % 2 == 1) ? "A" : "B";
    document.write('<tr class="lscold'+suff+'">');
    document.write('<td nowrap style="text-align: left"><a href="#" onClick="return openPopup('+i+')"><img src="images/popup.gif" width="16" height="16" border="0" align="left" hspace="1" alt="Graphic Chart"><div class="stockname'+suff+'" source="lightstreamer" table="stocks" item="item'+i+'" field="stock_name">Loading...</div></a></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="last_price">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="time">-</div></td>');
    document.write('<td><span source="lightstreamer" table="stocks" item="item'+i+'" field="#arrow"><img src="images/spacer.gif" width="20" height="8" border="0"></span></td>');
    document.write('<td nowrap="nowrap"><div source="lightstreamer" table="stocks" item="item'+i+'" field="pct_change">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="bid_quantity">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="bid">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="ask">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="ask_quantity">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="min">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="max">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="ref_price">-</div></td>');
    document.write('<td><div source="lightstreamer" table="stocks" item="item'+i+'" field="open_price">-</div></td>');
    document.write('</tr>');
    }
    In Ex, I have 10 line(10 stock name). And now, i need to write x line. Adapter will sent to client x line. How to web client write x line in html???

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,017
    In a normal scenario, we assume that any back-end information is available to the Web Server, if needed.
    Hence, the Web Server is still responsible for knowing what the supplied page is supposed to display.
    In this case, if the page has to show all the available stocks,
    the Web Server should ask to your feed for the list of available stocks,
    so that the Web Server can compose the page
    and make it show the stocks and ask Lightstreamer for the real time updates for those stocks.

    However, if you find it easier to ask for the list of available stocks through Lightstreamer
    (for instance, if you are using a simple feed simulator which is difficult to connect to your Web Server)
    then your page could get the list by subscribing to a COMMAND mode item.
    Obviously, your Data Adapter has to be extended, in order to supply this new item, according to the information it can get from the feed.
    Your page, in order to handle the received list and subscribe to all the received stocks,
    can take advantage of a MultiDynaMetapushTable,
    as demonstrated in the predeployed Portfolio Demo example provided with the distribution package.

  7. #7
    Member
    Join Date
    Aug 2009
    Location
    Binh Duong
    Posts
    14
    Thanks for your help!

 

 

Similar Threads

  1. Replies: 1
    Last Post: July 13th, 2011, 10:13 AM
  2. Feeding LS with less number of fields as expected by LS
    By Pradeep Chahal in forum Adapter SDKs
    Replies: 1
    Last Post: November 6th, 2009, 09:28 AM
  3. This is different...problem with stock name
    By lethanhclub in forum Adapter SDKs
    Replies: 1
    Last Post: September 11th, 2009, 10:39 AM
  4. This is different...problem with stock name
    By lethanhclub in forum Client SDKs
    Replies: 0
    Last Post: September 11th, 2009, 04:49 AM
  5. Replies: 3
    Last Post: February 8th, 2007, 10:11 AM

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:01 AM.