You could place your widget in a data view that listens to a data grid. Then the object of the data view, which is the selected object in the data grid, is available to your widget. This does not work for multi-select, though.
Thanks for the answer but that is not exactly what I want to accomplish. What I want is a list of objects and do something with it within my widget.
I could also select the entity and use xpath to retrieve all the objects I want, but then I miss the fact that my widget is not refreshed if the data changes. But maybe there is another way from within the widget to make it listen to the entity?