DynDeveloper.com

DynDeveloper.com

Sign Up Now!Log In
bobx 3/7/2013 3:19:32 PM

.NET Development

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

When coding a .NET transactional form, we end up putting the same piece of code in those forms over and over - the form state code.

Every form is different, but generally we use three form states = CLEAN, POPULATED, and DIRTY. We'll use an 'Item' form for discussions sake

  1. Clean is for when the form is newly opened. Generally every field on the form is disabled except the main lookup field and maybe a lookup button.
  2. Populated is when the user has selected an item, but has not edited anything. Generally the item number field would be disabled, but the lookup button would not be, and all the form fields would be enabled
  3. Dirty is when the form has been edited an it needs to be saved. Both the item number field and the item lookup button are disabled, all remaining fields are enabled.

We also have code to clear every field on the form.

Last, we have code to add event handlers to each field, so that when the field is edited the form will become DIRTY.

 

Version:
Section: