Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    20

    Angry LS getFieldValue not working

    Hi,

    As per my knowledge, LS kernel does the job of maintaining the count of subscription, un-subscription. If I subscribe to the same item twice in my Flex client I am getting weird values.

    The same piece of code as my previous post:

    Code:
    private function extractFieldValue(evt:NonVisualItemUpdateEvent,field:*):String {
    var value:String;
    if (evt.isFieldChanged(field)) {
    		value = evt.getFieldValue(field);
    		trace("Field : " + field + " Changed to : " + value);
    		if(field == "updateType"){
    			trace(describeType(value));
    		}
    } else {
    		value = evt.getOldFieldValue(field);
    		trace("Field : " + field + " Did not Change, old value : " + value)
    }
    				return value;
    }
    The server is sending string value "1" as updateType always. Its hard coded.
    But, when i subscribe it twice, I am getting the following result as output:
    Code:
    Field : updateType Changed to : 1
    <type name="String" base="Object" isDynamic="false" isFinal="true" isStatic="false">
      <extendsClass type="Object"/>
      <constructor>
        <parameter index="1" type="*" optional="true"/>
      </constructor>
      <accessor name="length" access="readonly" type="int" declaredBy="String"/>
    </type>
    Field : updateType Changed to : [object Object]
    <type name="String" base="Object" isDynamic="false" isFinal="true" isStatic="false">
      <extendsClass type="Object"/>
      <constructor>
        <parameter index="1" type="*" optional="true"/>
      </constructor>
      <accessor name="length" access="readonly" type="int" declaredBy="String"/>
    </type>
    From where am I getting [object Object]? The type is string itself. My adapter is not writing anything else than "1".

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

    I was not able to reproduce your issue.
    Which client version/build are you using?
    Can you show me how you instantiate and configure your NonVisualTable instance and your callback?

  3. #3
    Member
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    20
    Hi Mone,

    I am using the latest version of Lightstreamer. I downloaded it just a week back.
    Code:
    Lightstreamer Flash/Flex (Native AS) Client Library version 1.1 build 33
    Compatible with Lightstreamer Server since version 3.5
    Also, I have attached a log on my first post which contains LightstreamerLogger.subscriptions as DEBUG and the Flex log of the above.

    The code is this:
    Here fields is an array of Strings with required fields.
    And itemname is the subscription item.

    Code:
    		public function subscribe(itemName:String,fields:Array):void{
    				var nonVisualTable:NonVisualTable = new NonVisualTable(new Array(itemName),fields,"MERGE");
    				nonVisualTable.setDataAdapter("MBTLSADAPTER");
    				nonVisualTable.setSnapshotRequired(false);
    				nonVisualTable.addEventListener(NonVisualItemUpdateEvent.NON_VISUAL_ITEM_UPDATE,onChange);
    				lsclient.subscribeTable(nonVisualTable);
    				if(!dictionary.hasOwnProperty(itemName)){
    					dictionary[itemName] = new ArrayCollection();
    				}
    				ArrayCollection(dictionary[itemName]).addItem(nonVisualTable);			
    		}

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

    Wink

    Hello,

    I've finally found the key to reproduce your issue.
    The problem arises whenever you subscribe to a certain list of fields but the server publishes updates only for a limited number of such fields.
    In your case (accordingly to your log) you subscribe to 24 fields, while the adapter publishes updates for only 6 fields.
    This is obviously a bug of the flex client library.

    We already have a fixed version of the library in our repositories.

    So You've now two possibilities to solve your problem:
    avoid the subscription of not-updated fields (if possible) OR write an email to support@lightstreamer.com asking for the fixed version.

    Thanks for your patience,
    Bye!

  5. #5
    Member
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    20
    Thanks a lot for all the support

 

 

Similar Threads

  1. Lightstreamer not working on my desktop
    By indir741 in forum General
    Replies: 1
    Last Post: June 15th, 2011, 05:20 PM
  2. Demo not working within my framework...
    By athanasius2 in forum General
    Replies: 3
    Last Post: April 17th, 2009, 12:40 PM
  3. Working examples!
    By jkrassman in forum Client APIs
    Replies: 1
    Last Post: November 5th, 2007, 11:37 AM
  4. Replies: 6
    Last Post: May 7th, 2007, 05:19 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 02:41 PM.