Results 1 to 10 of 14

Hybrid View

  1. #1
    Member
    Join Date
    Oct 2007
    Location
    Markham
    Posts
    4

    Can't ask for the field name?

    Hi Mone,

    The getNewValue method works when i call it with a 1-based index, but not when i try to use the field name (e.g. "price", "time", "type", etc). Is there a way to get LS to recognize the field name instead?

    Best regards,
    Matthew

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    to let the web client recognize the item and field names just follow approach 2 as explained.
    Check approach2.html in the zip file to see the complete source code.

  3. #3
    Member
    Join Date
    Oct 2007
    Location
    Markham
    Posts
    4
    Thanks, but i tried that, and never got any data. In my DataAdapter i am calling the smart update with a Map object as the fields, and using field names such as "value", "time", "type", and "index". But in the JS the method calls getNewValue(1), and getNewValue("1") work (as as well for other indices), but the calls getNewValue("value"), getNewValue("time"), etc do not.

    I had assumed that leaving out the field names was maybe some kind of bandwidth performance setting. Might this be the case or am i doing something wrong?

    Best regards,
    Matthew

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    Are you using your own MetadataProvider or a given one (LiteralBasedProvider or similar is needed)?
    Have you created your table using as schema an array of field names?

    About bandwidth note that item/field names never go through the stream.


    PS: I noticed that this tutorial use the loadEngineMinimal method. Please upgrade to the new createEngine method as loadEngineMinimal is a deprecated method (I will update this tutorial as soon as possible)
    PPS: Updated!

  5. #5
    Member
    Join Date
    Oct 2007
    Location
    Markham
    Posts
    4
    Hi Mone,

    Yes, i created my own MetadataProvider. How would that affect things?

    I create by table thus:
    var newTable = new NonVisualTable("test6", "value time index", "DISTINCT");

    Thanks,
    Matthew

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    There are two conditions to let you access data with item/field names:
    1. You must create the Table object using as group/schema an array of strings. Each string should be the name of an item/field.
      The web client will concatenate the strings using a space as separator.
    2. The getItems /getSchema method of the MetadataProvider implementation must split the received id/schema on the space character and handle each token as an item/field name.
      This is the behavior of the LiteralBasedProvider.

    You should create your table as below:

  7. #7
    Member
    Join Date
    Oct 2007
    Location
    Markham
    Posts
    4
    Hurray! Thanks Mone, that works much better.

 

 

Similar Threads

  1. ASP.NET Web Client Tutorial
    By rmusco in forum Client SDKs
    Replies: 9
    Last Post: February 1st, 2011, 01:40 PM
  2. simple multiple records from database
    By smugford in forum General
    Replies: 8
    Last Post: January 11th, 2011, 09:20 AM
  3. Simple Web Server
    By Isanderthul in forum General
    Replies: 1
    Last Post: July 15th, 2009, 09:05 AM
  4. New Tutorial Available
    By Alessandro in forum Adapter SDKs
    Replies: 2
    Last Post: October 30th, 2008, 02:10 PM
  5. Simple Grid Demo Released
    By Alessandro in forum Client SDKs
    Replies: 0
    Last Post: November 24th, 2006, 03:49 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 11:37 PM.