A Selector allows you to filter out update events for an item.

For COMMAND-mode items usually the "key" field (or a field that depends on the "key" field) is used to decide the selection policy.

This allows the front-end page to set filters on the table rows in order to display table subsets (e.g., in a portfolio scenario, only the titles from a specific user account). Without Selectors, for each subset, a different item would be required (see this thread: http://www.lightstreamer.com/vb/showthread.php?t=58). With Selectors, a single item can be used for the whole set and each subset can be subscribed by specifying the filtering expression to be applied. However, the filtering action is delegated to custom code, to be placed in the Metadata Adapter.

As an example, you may set a filtering constraint in the Push-page JavaScript code with some code like this:
Code javascript:
  1. var myTable = new DynaMetapushTable("portfolio", mySchema, "COMMAND");
  2. myTable.setSelector("account==1");
on the object that represents your data table (see setSelector() for details).
After a similar subscription from some client browser, the Server, upon each update for the item, before the update is sent to the proper ItemEventBuffer, invokes on the Metadata Adapter the isSelected() method, that you have to implement, where the filtering decision, based on the "account==1" selector, is taken.