Added a callback function so a view can be updated when it is displayed