Returns the id of the selected item (if any)