// Ensure the super implementation executes
super.onInit();
form = new CssForm("form");
VerticalFieldSet fieldset = new VerticalFieldSet("contactDetails");
fieldset.setLegend("Contact Details");
fieldset.add(new TitleSelect("title"));
fieldset.add(new TextField("firstName")).setRequired(true);
fieldset.add(new TextField("middleNames"));
fieldset.add(new TextField("lastName")).setRequired(true);
fieldset.add(new TextField("contactNumber"));
fieldset.add(new EmailField("email"));
form.add(fieldset);
fieldset = new VerticalFieldSet("paymentDetails");
fieldset.setLegend("Payment Details");
RadioGroup paymentGroup = new RadioGroup("paymentOption");
paymentGroup.add(new Radio("cod", "Cash On Delivery "));
paymentGroup.add(new Radio("credit", "Credit Card "));
paymentGroup.setVerticalLayout(false);
fieldset.add(paymentGroup);
// Retrieve the paymentGroup's ListItem, and set its CSS class to "radio"
ListItem item = (ListItem) fieldset.getHtmlList().getLast();
item.setAttribute("class", "radio");
fieldset.add(new TextField("cardholderName"));
fieldset.add(new CreditCardField("cardNumber")).setRequired(true);
fieldset.add(new IntegerField("expiry"));
form.add(fieldset);
Submit ok = new Submit("ok", "OK");
Submit cancel = new PageSubmit("cancel", ContactDetailsPage.class);