fieldSet.add(investmentsField);
dateJoinedField = new DateField("dateJoined");
fieldSet.add(dateJoinedField);
form.add(new Submit("ok", " OK ", this, "onOkClick"));
Submit cancel = new PageSubmit("cancel", HomePage.class);
cancel.setCancelJavaScriptValidation(true);
form.add(cancel);
addControl(form);
// Setup control form
optionsForm = new Form("optionsForm");
optionsForm.setColumns(3);
optionsForm.setLabelAlign("right");
optionsForm.setListener(this, "onApplyChanges");
optionsForm.setLabelStyle("padding-left:2em;");
fieldSet = new FieldSet("props", "<b>Form Properites</b>");
optionsForm.add(fieldSet);
buttonAlignSelect = new Select("buttonAlign");
buttonAlignSelect.addAll(new String[] { "left", "center", "right" });
buttonAlignSelect.setTitle("Buttons horizontal alignment");
buttonAlignSelect.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(buttonAlignSelect);
columnsSelect = new Select("columns");
columnsSelect.addAll(new String[] { "1", "2", "3", "4" });
columnsSelect.setTitle("Number of Form table columns");
columnsSelect.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(columnsSelect);
buttonStyle = new TextField("buttonStyle");
buttonStyle.setTitle("Button td style attribute");
buttonStyle.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(buttonStyle);
errorsAlignSelect = new Select("errorsAlign");
errorsAlignSelect.addAll(new String[] { "left", "center", "right" });
errorsAlignSelect.setTitle("Errors block horizontal alignment");
errorsAlignSelect.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(errorsAlignSelect);
errorsPositionSelect = new Select("errorsPosition");
errorsPositionSelect.addAll(new String[] { "top", "middle", "bottom" });
errorsPositionSelect.setTitle("Form errors position");
errorsPositionSelect.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(errorsPositionSelect);
errorsStyle = new TextField("errorsStyle");
errorsStyle.setTitle("Errors td style attribute");
errorsStyle.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(errorsStyle);
labelAlignSelect = new Select("labelAlign");
labelAlignSelect.addAll(new String[] { "left", "center", "right" });
labelAlignSelect.setTitle("Field label alignment");
labelAlignSelect.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(labelAlignSelect);
labelsPositionSelect = new Select("labelsPosition");
labelsPositionSelect.addAll(new String[] {"left", "top"});
labelsPositionSelect.setTitle("Form labels position");
labelsPositionSelect.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(labelsPositionSelect);
labelStyle = new TextField("labelStyle");
labelStyle.setTitle("Label td style attribute");
labelStyle.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(labelStyle);
disabledCheckbox = new Checkbox("disabled");
disabledCheckbox.setAttribute("onclick", "optionsForm.submit();");
fieldSet.add(disabledCheckbox);
readonlyCheckbox = new Checkbox("readonly");
readonlyCheckbox.setAttribute("onclick", "optionsForm.submit();");
fieldSet.add(readonlyCheckbox);
fieldStyle = new TextField("fieldStyle");
fieldStyle.setTitle("Field td style attribute");
fieldStyle.setAttribute("onchange", "optionsForm.submit();");
fieldSet.add(fieldStyle);
validateCheckbox = new Checkbox("validate");
validateCheckbox.setAttribute("onclick", "optionsForm.submit();");
fieldSet.add(validateCheckbox);
javaScriptValidateCheckbox = new Checkbox("javaScriptValidate", "JavaScript Validate");
javaScriptValidateCheckbox.setAttribute("onclick", "optionsForm.submit();");
fieldSet.add(javaScriptValidateCheckbox);
showBordersCheckbox = new Checkbox("showBorders");
showBordersCheckbox.setAttribute("onclick", "optionsForm.submit();");
fieldSet.add(showBordersCheckbox);
optionsForm.add(new Submit("restoreDefaults", this, "onRestoreDefaults"));
addControl(optionsForm);
// Setup showBorders checkbox Javascript using HTML head include and
// setting the body onload function.