Results 1 to 10 of 11

Hybrid View

  1. #1
    Member
    Join Date
    Nov 2007
    Location
    Shanghai
    Posts
    5

    Question Can I receive the original data?

    Hi,

    In my assumption, I want to directly receive the data from server without throught the Table. That is to say, I just want to handle the original data from sever and undefine the schema and group. Is this a logical assumption? If yes, how can I capture the server map data without the schema and group?

    I puerilely wrote the following test code:

    /////////////////////////////////////////////////////////////////////
    var myTable = new NonVisualTable("","","MERGE");//Empty the group and schema
    myTable.setSnapshotRequired(true);
    myTable.onItemUpdate = function(item, itemUpdate) {
    ......
    }
    lsPage.addTable(myTable,"test");
    /////////////////////////////////////////////////////////////////////

    The test result is failed as my forecast.

    Is there any other ways for this assumption?

    Thanks for any ideas!

    Best Regards,
    Johnny Yau

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    The items and fields related to a table are decided server side by the MetadataProvider.
    When you subscribe a table you're not sending to the server item and field names, but a group name and a schema name.
    Usually group and schema names are composed by space-separated item and field names. This special case is handled by the LiteralBasedProvider that is a MetadataProvider implementation distributed with the server.
    If you implement your own MetadataProvider class (maybe extending an existing one)
    you can completely change this logic implementing two methods: getItems and getSchema.

    Look the following example. I will use "ALL" as group name and I will be returned with the 30 items of the StockListDemo.

    First I change the adapters.xml file of the classic StockListDemo as follows (note that the only difference is the metadata_provider class name:


    This is the AllMetaExampleimplementation:


    and finally a simple client:


    Note that once you give to the Table constructor a String instead of an Array (as in this case) you can't no more acces items by name but you must handle item indexes.
    Some useful links:
    http://www.lightstreamer.com/docs/client_web_jsdoc/Table.html#Table()
    http://www.lightstreamer.com/docs/cl...eItemInfo.html
    http://www.lightstreamer.com/vb/show...lBasedProvider

    Please check the FileBasedProvider before starting implement your own MetadataProvider. Maybe it already fit your needs.

    Hope that helps.

  3. #3
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    PS: the null passed as group and/or schema name does not mean to give to you everything, but means "get the item and field names from the html template that will contain the updates". Obviously this is not possible with a NonVisualTable and is suitable only for LiteralBasedProvider-like MetadataAdapters.

  4. #4
    Member
    Join Date
    Nov 2007
    Location
    Shanghai
    Posts
    5
    Hi Mone,

    Thanks for your help.

    I have took a look for here http://www.lightstreamer.com/vb/show...lBasedProvider.

    In my project, I want use NonVisualTable like that but pass null as group and/or schema name. It sounds like wishful thinking

  5. #5
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    sorry, but I don't understand why you want to use null as schema and group name.
    Isn't my example suitable for your needs?

  6. #6
    Member
    Join Date
    Nov 2007
    Location
    Shanghai
    Posts
    5
    My project tearm have choosen the push technology - pushlet before I join. Now the performance is not suitable for the customer requirements. So we focus on the lightstreamer. But the pushlet web client development have been completed. I want to establish an adapter between pushlet and lightstreamer. I have completed the server-side codes, but broken by the group and schema. If can pass null as group and schema name on NonVisualTable, I will finish the switch workload and suggest to purchase the commercial edition lightstreamer. Of course, I also can suggest for project term to rewrite the client codes. I think it is not a very difficult matter

    Thanks for your useful help. I have got a short cut for the lightstreamer.

    cheers

  7. #7
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    Hi everybody.
    Please, in the case where i have this in AllMetaExample
    Code:
    public class AllMetaExample extends LiteralBasedProvider {
    
        private static String[] completeList;
        
        static {
                completeList[] = geFromDB();
        }
    
        private String[] geFromDB(){
                 .........
        }
    }
    So, how can i know the number of elements that i will be subscribed to from the client ?
    What will i put in this HTML line:

    Code:
                for (var i = 1; i <= ???; i++) {
    Or should i use a DynaScrollTable ? Or can i still use OverwriteTable ?

  8. #8
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    Currently, the number of items corresponding to the expansion of a symbolic group name is not communicated by the Server to the client.
    We always assume that the client knows in advance the meaning of the symbolic group names it submits to the Server,
    so that it has already been able to provide the suitable space on the page for displaying the value before subscribing.

    For any case of management of lists of unknown length, the COMMAND mode and the DynaMetapushTable were provided.
    Note that the DynaScrollTable, combined with DISTINCT, mode also displays variable length lists, but it doesn't allow you to update the values, only to grow the list.

    Otherwise, application level mechanisms have to be leveraged; for instance, you could subscribe to an item which provides the list length.

 

 

Similar Threads

  1. Client receive old data after some time.
    By mnenchev in forum General
    Replies: 3
    Last Post: November 25th, 2009, 02:27 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 06:41 PM.