write selection status to db, display items in main view