Skip to content
moellep edited this page Nov 13, 2014 · 4 revisions

FormModel

Provides incoming data validation and changes to the database

Typical lifecycle of a form on the web

  1. click some link on another page to open the form
    say, from a list of users we drill into the form to change contact info in which case we want the form populated with their existing data

  2. user types in information to the form

  3. present the form again with error messages
    say, the incoming data had a malformed date, or email address

  4. accept the new data from the user and persist it

  5. OR user click's cancel to abandon the changes

Interfaces of interest

execute_empty()

execute_cancel()

execute_other()

execute_ok()

validate()

internal_pre_execute()

Other thoughts

  • We want to show the user ALL of the errors they made on the form in one go rather than showing them only the first error.

  • We want to give the user back the data they entered so they can see their own mistake, or to reduce the typing they have to do to correct it.

  • When we send the user back to the list, we want to return them to the same page with the same sort order and search criteria.

  • In the case of a login form, we want the completion of login to send the user wherever they were intending to go before they were interrupted to present their credentials.

Examples

FormModel sequence diagram (Click for larger view)

Clone this wiki locally