<%@ page session="false"%> <%@ page import="objectivehtml.htmlwidget.*" %> <%@ page import="mypackage.*" %>

Customer Details

All fields with an asterix (*) are mandatory fields.

<% // lets see if this is the first time the form is loaded if (request.getParameter("m_btnSave") == null) { // create a new form CustomerForm objForm = new CustomerForm(); // our self defined form // this method prints out the current state of the form out to the client objForm.printHtml(out); // store the new form in the session so we can use it later request.getSession().setAttribute("customerform", objForm); } else { // retrieve the previous form object CustomerForm objForm = (CustomerForm)request.getSession().getAttribute("customerform"); if (objForm == null) { // we need to create the form first... // this can occur if the page is cached // create a new form objForm = new CustomerForm(); // our self defined form // store the new form in the session so we can use it later request.getSession().setAttribute("customerform", objForm); } // end if null // this method magically updates all form data objForm.updateData(request); // call user method objForm.saveForm(); // this method prints out the current state of the form out to the client objForm.printHtml(out); } %>