Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2008
    Location
    hanoi
    Posts
    1

    Unhappy Update Table Problem

    I wrote an .Net adapter that nearly the same to MessengerDemo adapter for MessengerDemo site. I encountered with the problem that : when the first user login into site, his name would not be displayed on the buddies-list, but his name would be displayed on this list if he is the second user or so on. My change to this adapter was only in subscribe method :

    Code:
            
            public void Subscribe(string itemName)
            {
                if (itemName.StartsWith(USER_PREFIX))
                {
                    string userName = itemName.Substring(USER_PREFIX.Length);
                    if (chatTableDic.ContainsKey(userName))
                    {
                        throw new Exception("This user is exist !");
                    }
    
                    lock (synObj)
                    {
                        if (!chatTableDic.ContainsKey(userName))
                        {
                            chatTableDic.Add(userName, new ChatUser(userName, itemName));
                            chatParners.Add(userName, new Dictionary<string, ChatUser>());
    
                            UpdateOnlineList("ADD", userName, false);
                        }
                    }
                }
            }
    
            private void UpdateOnlineList(string command, string key, bool isForSnapshot)
            {
                string desTable = LIST_TABLE;
                
                var update = new Hashtable();
                update.Add("command", command);
                update.Add("key",key);
    
                ThreadPool.QueueUserWorkItem(delegate { listener.Update(desTable, update, isForSnapshot); });
            }
    
    (LIST_TABLE is a name of buddy-list table)
    So could you tell what i was wrong here?
    Thank you so much !

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    You use the LIST_TABLE item in an incorrect way, as you send updates for it regardless that a "subscribe" call has been received for it.
    When "subscribe" is received for the user messages item, you have no guarantee that the subscription process for the LIST_TABLE item has been completed. Therefore, the consequent update to LIST_TABLE, even though it is deferred, may be discarded by Lightstreamer.
    When the second user comes in, the LIST_TABLE item is already known by Lightstreamer because it is currently subscribed to by the first user. Hence, the related update to LIST_TABLE, if it comes before the subscription, is kept in the item snapshot and can eventually reach the cient.

  3. #3
    Member
    Join Date
    Nov 2009
    Location
    Nashville
    Posts
    1

    Push HTML to WEB Client

    Not sure where to post this question ...
    I've created an app using LS and so far everything works fine. I'm using IIS, asp.net, c# etc. I would like to push HTML to the client, mainly html tables to be rendered inside the div elements but it's not working, it's rendering the HTML text instead of the formatted. This is my adapter code:

    ...
    this.TableHeader();
    this.TableRow(this._dt1.Rows[0]["dt_StartDateTime"].ToString(), this._dt1.Rows[0]["ds_AdminMessage"].ToString());
    this.TableFooter();
    this._eventData["admin_messages"] = this._sbTable.ToString();
    this._intID_ADMIN = intID;

    private void TableHeader()
    {
    this._sbTable.Length = 0;
    this._sbTable.Append("<br/>");
    this._sbTable.Append("<table border=0 cellpadding=2; cellspacing=3 width=100%>");
    }

    private void TableRow(string strCol1, string strCol2)
    {
    this._sbTable.Append("<tr>");
    this._sbTable.Append("<td bgcolor=#fffacd width=20%>" + strCol1 + "</td>");
    this._sbTable.Append("<td align=\"right\" bgcolor=#fffacd width=25%>" + strCol2 + "</td>");
    this._sbTable.Append("</tr>");
    }

    private void TableFooter()
    {
    this._sbTable.Append("</table>");
    this._sbTable.Append("<br/>");
    }
    ...

    client container

    <div id="divAdministrativeMessages_content" runat="server">
    <div style="background-color: #FFFFBB; border: solid 1px Black; height: 165px; overflow: auto;">
    <div source="lightstreamer" table="signalstable" item="eurusd" field="admin_messages">
    </div>
    </div>
    </div>

    Please help, thanks. The link to the page is

    http://www8.selfip.com/fxgoldkeyssig...fsignals1.aspx

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Push of HTML contents has to be enabled on the client Table through setPushedHtmlEnabled.

 

 

Similar Threads

  1. update items with the same value
    By TehHector in forum Client APIs
    Replies: 2
    Last Post: April 26th, 2011, 10:46 AM
  2. Replies: 3
    Last Post: February 19th, 2010, 12:14 AM
  3. Update Table
    By EWANG in forum Client APIs
    Replies: 1
    Last Post: August 19th, 2009, 11:17 AM
  4. Dojo 0.9 Update
    By rakeshxp in forum Client APIs
    Replies: 1
    Last Post: August 27th, 2007, 12:42 PM
  5. order by update
    By jamesclinton in forum Client APIs
    Replies: 1
    Last Post: March 12th, 2007, 05:54 PM

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 05:20 AM.