This should all move to the $render method and you should just call $render when readonly changes.