I have a model that transitions through several states throughout its lifecycle. As the model transitions between states, field attributes change. For example, when in a 'draft' state, some fields of the model are invisible. When in an 'open' state, some fields are readonly.
Right now, all of this view logic is contained within a single view. Consequently, the xml is difficult to read and it is easy to make mistakes in setting field attributes. It seems a better approach would be to have a separate view defined for each model state; however, to do this I would need to know how to select a view based off of a model's state.
How might I implement the conditional selection of views based off of a model's state?