It is usually possible to control when features are selected, but controlling when they are unselected is a problem.
For example, say you have a list widget that opens a page that displays details for the chosen list item.
A list action updates the selection of the layer that drives when is displayed on the details page.
But if you click on an item in the list a second time it unselects the record but still opens the linked details page, which then displays blank data.
Either of the following work would to remedy this, but they aren't currently supported:
- Disable the behavior of list items being unselected when clicked on a second time
- Have a custom "close" button on the details page clear a layer's selection. Adding selection actions to buttons would make buttons much more useful that they currently are.
A work-around is to add a transparent button over the top of the Selected list element, with the button's link opening the details page. The button gets the click event instead of the list widget, and therefore the list element never gets unselected. But it requires that the list's Selected state have a custom layout, and I suspect that not many people will think of using this method.