|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.click.control.AbstractControl
org.apache.click.control.AbstractContainer
org.apache.click.control.Form
org.apache.click.extras.control.TabbedForm
public class TabbedForm
Provides a Tabbed Form control: <form method='post'>.
|
FieldSet control which are added to the form.
public DeliveryDetailsEditor() {
form.setBackgroundColor("#F7FFAF");
form.setTabHeight("210px");
form.setTabWidth("420px");
// Contact tab sheet
FieldSet contactTabSheet = new FieldSet("contactDetails");
form.addTabSheet(contactTabSheet);
contactTabSheet.add(new TitleSelect("title"));
contactTabSheet.add(new TextField("firstName"));
contactTabSheet.add(new TextField("middleNames"));
contactTabSheet.add(new TextField("surname", true));
contactTabSheet.add(contactNumber);
contactTabSheet.add(new EmailField("email"));
// Delivery tab sheet
FieldSet deliveryTabSheet = new FieldSet("deliveryDetails");
form.addTabSheet(deliveryTabSheet);
TextArea textArea = new TextArea("deliveryAddress", true);
textArea.setCols(30);
textArea.setRows(3);
deliveryTabSheet.add(textArea);
deliveryTabSheet.add(new DateField("deliveryDate"));
PackagingRadioGroup packaging = new PackagingRadioGroup("packaging");
packaging.setValue("STD");
deliveryTabSheet.add(packaging);
deliveryTabSheet.add(telephoneOnDelivery);
// Payment tab sheet
FieldSet paymentTabSheet = new FieldSet("paymentDetails");
form.addTabSheet(paymentTabSheet);
paymentGroup.add(new Radio("cod", "Cash On Delivery"));
paymentGroup.add(new Radio("credit", "Credit Card"));
paymentGroup.setVerticalLayout(false);
paymentTabSheet.add(paymentGroup);
paymentTabSheet.add(cardName);
paymentTabSheet.add(cardNumber);
paymentTabSheet.add(expiry);
expiry.setSize(4);
expiry.setMaxLength(4);
// Buttons
form.add(new Submit("ok", " OK ", this, "onOkClick"));
form.add(new Submit("cancel", this, "onCancelClick"));
addControl(form);
}
| Field Summary | |
|---|---|
protected String |
backgroundColor
The form HTML background color. |
protected int |
displayTab
The tab number to display (indexed from 1). |
protected String |
tabHeight
The tab sheet height HTML attribute value. |
protected List<FieldSet> |
tabSheets
The list of FieldSet tab sheets. |
protected String |
tabWidth
The tab sheet width HTML attribute value. |
protected String |
template
The path of the tabbed form Velocity template to render. |
| Fields inherited from class org.apache.click.control.Form |
|---|
actionURL, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, buttonAlign, buttonList, buttonStyle, columns, defaultFieldSize, disabled, enctype, error, errorsAlign, errorsPosition, errorsStyle, fieldList, fieldStyle, fieldWidths, FOCUS_JAVASCRIPT, FORM_NAME, formSubmission, javaScriptValidation, labelAlign, labelsPosition, labelStyle, method, MULTIPART_FORM_DATA, POSITION_BOTTOM, POSITION_LEFT, POSITION_MIDDLE, POSITION_TOP, readonly, SUBMIT_CHECK, validate |
| Fields inherited from class org.apache.click.control.AbstractContainer |
|---|
controlMap, controls |
| Fields inherited from class org.apache.click.control.AbstractControl |
|---|
actionListener, attributes, behaviors, headElements, listener, listenerMethod, messages, name, parent, styles |
| Fields inherited from interface org.apache.click.Control |
|---|
CONTROL_MESSAGES |
| Constructor Summary | |
|---|---|
TabbedForm()
Create a new tabbed form instance with no name defined. |
|
TabbedForm(String name)
Create a new tabbed form instance with the given name. |
|
| Method Summary | |
|---|---|
void |
addTabSheet(FieldSet tabSheet)
Add the given FieldSet tab sheet to the form. |
String |
getBackgroundColor()
Return the form HTML background color. |
int |
getDisplayTab()
Return the number of the tab sheet to display (indexed from 1). |
List<Element> |
getHeadElements()
Return the TabbedForm HTML HEAD elements for the following resources: click/extras-control.js click/extras-control.css Additionally all the Form import statements are also returned. |
String |
getTabHeight()
Return the tab sheet height HTML attribute value. |
int |
getTabSheetNumber(String fieldName)
Return the tab sheet number for the given field name, indexed from 1. |
List<FieldSet> |
getTabSheets()
Return list FieldSet tab sheets. |
String |
getTabWidth()
Return the tab sheet width HTML attribute value. |
String |
getTemplate()
Return the path of the Velocity template to render. |
boolean |
onProcess()
Process the Form request. |
void |
render(HtmlStringBuffer buffer)
Render the HTML representation of the TabbedForm. |
protected void |
renderValidationJavaScript(HtmlStringBuffer buffer,
List<Field> formFields)
|
void |
setBackgroundColor(String value)
Set the form HTML background color. |
void |
setDisplayTab(int value)
Set the number of the tab sheet to display (indexed from 1). |
void |
setTabHeight(String value)
Set the tab sheet height HTML attribute value. |
void |
setTabWidth(String value)
Set the tab sheet width HTML attribute value. |
void |
setTemplate(String template)
Set the path of the Velocity template to render. |
String |
toString()
Return the HTML string representation of the form. |
| Methods inherited from class org.apache.click.control.AbstractContainer |
|---|
contains, getControl, getControlMap, getControls, hasControls, onInit, onRender, renderChildren, renderContent, renderTagEnd |
| Methods inherited from class org.apache.click.control.AbstractControl |
|---|
addBehavior, addStyleClass, appendAttributes, dispatchActionEvent, getActionListener, getAttribute, getAttributes, getBehaviors, getContext, getHtmlImports, getId, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, hasAttribute, hasAttributes, hasBehaviors, hasStyles, isAjaxTarget, onDeploy, removeBehavior, removeStyleClass, renderTagBegin, setActionListener, setAttribute, setId, setParent, setStyle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.click.Control |
|---|
getBehaviors, getContext, getId, getMessages, getName, getParent, hasBehaviors, isAjaxTarget, onDeploy, setParent |
| Field Detail |
|---|
protected String backgroundColor
protected int displayTab
protected String tabHeight
protected List<FieldSet> tabSheets
protected String tabWidth
protected String template
| Constructor Detail |
|---|
public TabbedForm(String name)
name - the name of the formpublic TabbedForm()
| Method Detail |
|---|
public void addTabSheet(FieldSet tabSheet)
tabSheet - the FieldSet tab sheet to addpublic String getBackgroundColor()
public void setBackgroundColor(String value)
value - the form HTML background colorpublic int getDisplayTab()
public void setDisplayTab(int value)
value - the number of the tab sheet to displaypublic List<Element> getHeadElements()
Form import statements are also returned.
getHeadElements in interface ControlgetHeadElements in class FormControl.getHeadElements()public String getTabHeight()
public void setTabHeight(String value)
value - the tab sheet height attribute valuepublic List<FieldSet> getTabSheets()
public int getTabSheetNumber(String fieldName)
fieldName - the name of the form field
public String getTabWidth()
public void setTabWidth(String value)
value - the tab sheet width attribute valuepublic String getTemplate()
public void setTemplate(String template)
template - the path of the Velocity template to renderpublic boolean onProcess()
onProcess in interface ControlonProcess in class Formpublic void render(HtmlStringBuffer buffer)
render in interface Controlrender in class Formbuffer - the specified buffer to render the control's output totoString()public String toString()
/org/apache/click/extras/control/TabbedForm.htmIf the form contains errors after processing, these errors will be rendered.
toString in class AbstractContainer
protected void renderValidationJavaScript(HtmlStringBuffer buffer,
List<Field> formFields)
renderValidationJavaScript in class Form
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||