# orion.page.selection

The selection service tracks the selection in the current page. The page determines how selections are shown and made by the user, but typically they are managed in a list, table, or tree. Clients can use this service to get or set the current selection, or to register a listener that will be notified when the selection changes.

Here is an example of adding a listener to track selection changes:

     serviceRegistry.getService("orion.page.selection").then(function(service) {
       service.addEventListener("selectionChanged", function(fileURI) {
         //do something with the selection
       });
     });

See `orion.selection.Selection` in the client API reference for a complete list of functions available on the selection service.