View Full Version : .NET Selector Examples
wattsw
11-14-2006, 03:05 PM
I was wondering if there was any examples of how to implement a subscription to a table that has a selector? What is required for both the client and server (data adapter)? Also, it appears that no matter what mode I select (RAW, MERGED, DISTINCT), I still receive updates at the client that have "UNCHANGED" for some elements. Why is this so? Is there a way to push all data regardless if it has changed across pushes?
Thanks
Client-side you just need to add the desired selector to your table. In example, add a selector to a javascript (sorry I have no experience on the .NET side btw it will not differ a lot) table is made with one line of code:
myTable.setSelector("This is my selector");
Server-side you must implement the selector's logic inside the metadata adapter.
You must develop your own MetaDataProvider (http://www.lightstreamer.com/docs/adapter_java_javadoc/com/lightstreamer/interfaces/metadata/MetadataProvider.html) and implement both isSelectorAllowed (http://www.lightstreamer.com/docs/adapter_java_javadoc/com/lightstreamer/interfaces/metadata/MetadataProvider.html#isSelectorAllowed%28java.lang.String,%20java.lang.String,%20java.lang.String%2 9) and isSelected (http://www.lightstreamer.com/docs/adapter_java_javadoc/com/lightstreamer/interfaces/metadata/MetadataProvider.html#isSelected%28java.lang.String,%20java.lang.String,%20java.lang.String,%20com.l ightstreamer.interfaces.metadata.ItemEvent%29) methods.
The first method will decide if a specified selector is allowed for the specified user on the specfied item, while the second method lets you filter updates on a selector-basis.
Hope that helps,
Bye.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.