-
Getting old value
Hi,
I am using Flex client for lightstreamer. My data adapter, basically a stubber, is returning symbol, lastPrice, lastExchange.
Suppose, I subscribe to only one symbol, say IBM, I am trying to get the values of the above fields. I am using Non-Visual table.
Code:
var value:String;
if (evt.isFieldChanged(field)) {
value = evt.getFieldValue(field);
trace("Field : " + field + " Changed to : " + value)
} else {
value = evt.getOldFieldValue(field);
trace("Field : " + field + " Did not Change, old value : " + value)
}
return value;
The lastPrice is random data, and is being streamed properly.
Problem:
The problem is I am able to get the old value for symbol, i.e IBM, but the exchange which is also a constant, "EX" is coming as null. I was expecting a same behavior for exchange, giving me the old value.
-
This may depend on the subscription mode and the way data is supplied by the Data Adapter.
Please, produce a Server log with the "LightstreamerLogger.subscriptions" category set at DEBUG priority.
-
1 Attachment(s)
Hi DarioCrivelli,
Thanks for the reply.
I am attaching the log files related to Lightstreamer and also the log of using the above code snippet on the Flex UI. The Flex UI log has just two responses, because of the second problem that I am facing which I have posted in another thread, basically the updateType gets converted to string [object Object]. You can see the second response in Flexui.log, I am not getting the lastExch and updateType, but getting symbol in:
Code:
Field : lastExch Did not Change, old value : null
Thanks,
Shreyas
-
I see that data is supplied correctly and that MERGE mode is used, hence your expectations are correct.
We have to find something wrong and, as we couldn't replicate the case, we have to ask you to retry with an even simpler test.
I see, from the Server log, that the same table is subscribed to twice. Does the problem still occur if you only perform only one subscription?
Does the problem also occur if you replace "getOldFieldValue" with "getFieldValue" (which is equivalent in that context)?
Note: we also have to apologize for the documentation of the "NonVisualItemUpdateEvent" class, which is outdated. The correct documentation is now online at http://www.lightstreamer.com/docs/cl...doc/index.html
-
Hi
For not getting old value:
1.Does the problem still occur if you only perform only one subscription?
Yes
2.Does the problem also occur if you replace "getOldFieldValue" with "getFieldValue" (which is equivalent in that context)?
Yes
Basically, I dont get any value using getOldFieldValue or getFieldValue.
For [object Object] problem
1.Does the problem still occur if you only perform only one subscription?
No
2.Does the problem also occur if you replace "getOldFieldValue" with "getFieldValue" (which is equivalent in that context)?
For getFieldValue I have [object Object]
and for getOldFieldValue I have null
Please let me know If you need any more details. I am glad to help out solving these issues.
-
The solution is the same of this post