updatecustomer.jsp
Update customer information

customer
Update this record
The data controls for updating the record are inserted on the web page. Note that there is an {Error Messages} control on the page. This control does not mean that your page has errors; the {Error Messages} control marks the place where run time error messages will be displayed.
The page looks like this:

status StatusRec;
The next step in adding the data to the page is to configure
the JSF handler to accept the CID parameter that
the link will pass to it.function onPreRender(CID INT)
Now the JSF handler is configured to accept an integer
parameter named CID. customer.customerId = CID;
Now you have
assigned the ID number to the customer record. The next step is to
retrieve the record with this ID number from the databaseCustomerLib.GetCustomer(customer, status);
The GetCustomer function
works just like the GetCustomerAll function you used
previously, but the GetCustomer function retrieves
one record, while the GetCustomerAll function retrieves
an array of records. Now the customer record contains
the record with the ID passed to this JSF handler. function onPreRender(CID INT)
customer.CustomerId = CID;
CustomerLib.GetCustomer(customer, status);
end

Now when you click a link on the allcustomers.jsp page, the updatecustomer.jsp page loads with details about that customer's record. Right now, you can change the information in the fields on the web page, but there is no function to send those updates to the database. In the next section, you will use the UpdateCustomer function to make those updates to the database.
function updateRecord()
CustomerLib.UpdateCustomer(customer, status);
forward to "allcustomers";
end
The next step is to bind this function to the button on the web page.
Here is the complete code of the updatecustomer.egl file. If you see any errors marked by red X symbols in the file, make sure your code matches the code in this file: Completed updatecustomer.egl file after lesson 8
