using classic asp, over the years we have developed a framework to handle some fairly complex web crud pages.
the crud class is designed as some kind of "finite-state machine"
the state is preserved between posts using hidden fields, and every event on the pages raises a post with a certain action. according to the action triggered, and the previous state, the crud class performs certain operation (like running a query, saving a record, edit a record, etc...) an goes to another state.
these are some of the states we are handling so far
query: lets the user enter query criteria to filter data.
browse: shows the data in a table form. with pagination, ordering, etc...
new, edit, delete: well, pretty obvious
browse-single: like edit but read-only
etc...
in order to achieve the desired functionality we keep in hidden texts info like: actual action, actual mode, previous action, previous mode, id of the selected record, order criteria, etc...
now we have implemented some master-detail functionality but this approach is getting a bit too complex.
we have to keep in hidden fields the id of the parent record, the parent field, the mode of the parent, the mode of the child, the current tab, the previous tab (we divided the info among several tabs)...
things get even more complicated when you have to handle "custom" actions (like approving an invoice), or warnings, errors, custom "workflows" and thing like that...
on the end we see that with this approach things get too complicated as soon as we deviate from the standard crud case...
what do you think of this approach?
how do you handle these kind of things?
any pattern you can advice me to look?
how do you keep tracks of the form's state?