public class SimpleForm extends DwContentPanel
Modifier and Type | Class and Description |
---|---|
class |
SimpleForm.SField |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CSS_NAME |
CSS_BODY_NAME, CSS_CONTENT_NAME, CSS_HEADER_NAME, CSS_LIGHT_DARK, CSS_LIGHT_HEADER
Constructor and Description |
---|
SimpleForm() |
Modifier and Type | Method and Description |
---|---|
void |
addButton(Widget widget) |
void |
addCondition(SimpleFormAction action,
ComplexCondition... conditions)
Adds a complex condition to the form.
|
void |
addCondition(java.lang.String fieldKey,
SimpleFormCondition condition,
SimpleFormAction action)
Adds a simple condition to the form.
|
void |
addDependency(java.lang.String dependant,
java.lang.String dependsOn)
Triggers a reload whenever the selection of dependsOn changes.
|
java.lang.String |
addField(java.lang.Class<?> type,
SimpleFormFieldConfiguration... configs) |
java.lang.String |
addField(java.lang.Class<?> type,
java.lang.String name,
FormFieldLayoutConfiguration fieldLayoutConfig,
java.lang.Object value,
ValueProvider vp,
SimpleFormFieldConfiguration... configs)
Adds a new field to the form.
|
java.lang.String |
addField(java.lang.Class<?> type,
java.lang.String label,
SimpleFormFieldConfiguration... configs) |
java.lang.String |
addField(java.lang.Class<?> type,
ValueProvider vp,
SimpleFormFieldConfiguration... configs) |
java.lang.String |
addField(java.lang.Class<?> type,
ValueProvider vp,
java.lang.String label,
java.lang.Object value,
SimpleFormFieldConfiguration... configs) |
java.lang.String |
addField(java.lang.Class<?> type,
ValueProvider vp,
java.lang.String label,
SimpleFormFieldConfiguration... configs) |
java.lang.String |
addField(FormFieldProviderHook responsibleHook,
java.lang.String name,
FormFieldLayoutConfiguration fieldLayoutConfig,
java.lang.Object value,
ValueProvider vp) |
void |
addFieldDecorator(SimpleFormFieldDecorator fieldDecorator) |
void |
addFieldInfo(java.lang.String key,
FieldInfoDecorator.DelayedInfoMessage data) |
void |
addFieldInfo(java.lang.String key,
java.lang.String data) |
void |
addFieldMenu(java.lang.String key,
Menu menu) |
<D> void |
addHidden(java.lang.String name,
D value) |
void |
addSubmissionCallback(SimpleFormSubmissionCallback cb) |
void |
addSubmissionListener(SimpleFormSubmissionListener submissionListener) |
DwTextButton |
addSubmitButton() |
DwTextButton |
addSubmitButton(java.lang.String txt) |
HandlerRegistration |
addSubmitCompleteHandler(SubmitCompleteHandler handler) |
HandlerRegistration |
addValueChangeHandler(java.lang.String key,
ValueChangeHandler handler) |
void |
beginColumn() |
void |
beginColumn(double width,
double height) |
void |
beginColumn(double width,
double height,
MarginData marginData) |
void |
beginColumn(double width,
MarginData marginData) |
void |
beginColumn(MarginData marginData) |
void |
beginFieldset(double width,
double height,
java.lang.String label,
MarginData marginData) |
void |
beginFieldset(java.lang.String label)
Starts a new field group
|
void |
beginFloatRow() |
void |
beginFloatRow(double width,
double height) |
void |
beginFloatRow(double width,
double height,
MarginData marginData) |
void |
beginFloatRow(MarginData marginData) |
void |
beginRow() |
void |
beginRow(double width,
double height) |
void |
beginRow(double width,
double height,
MarginData marginData) |
void |
beginRow(MarginData marginData) |
void |
bind(java.lang.Object model)
Allows to issue a form binding
|
void |
clearButtonBar() |
void |
clearInvalid() |
static Widget |
createFormlessField(java.lang.Class<?> type,
SimpleFormFieldConfiguration... configs) |
void |
endColumn() |
void |
endGroup()
Ends the current group.
|
void |
endRow() |
static SimpleForm |
fromJson(SimpleFormJsonConfig config) |
static SimpleForm |
fromJson(java.lang.String formConfig) |
java.util.List<SimpleForm.SField> |
getAllSFields() |
java.lang.Object |
getBoundModel() |
ButtonBar |
getButtonBar() |
SimpleFormSubmissionCallback |
getCompositeSubmissionCallback() |
java.lang.String |
getCssName() |
Widget |
getDisplayedField(java.lang.String fieldKey) |
Widget |
getField(java.lang.String fieldKey)
Returns the field identified by fieldKey.
|
<T extends SimpleFormFieldDecorator> |
getFieldDecorator(java.lang.Class<? extends T> type,
java.lang.String id) |
SimpleFormFieldDecorator |
getFieldDecorator(java.lang.String id) |
java.util.List<SimpleFormFieldDecorator> |
getFieldDecorators() |
java.util.Collection<java.lang.String> |
getFieldKeys() |
FormFieldLayoutConfiguration |
getFieldLayoutConfigFor(java.lang.String key) |
java.lang.Class<?> |
getFieldType(java.lang.String fieldKey) |
Container |
getFieldWrapper() |
FormPanel |
getFormPanel() |
static SimpleForm |
getInlineInstance() |
static SimpleForm |
getInlineLabelessInstance() |
static SimpleForm |
getNewInstance() |
Widget |
getOldWidget() |
FormFieldProviderHook |
getResponsibleHook(java.lang.String fieldKey) |
static FormFieldProviderHook |
getResponsibleHooker(java.lang.Class<?> type,
SimpleFormFieldConfiguration... configs) |
static FormFieldProviderHook |
getResponsibleHooker(java.lang.String type,
SimpleFormFieldJson config) |
SimpleForm.SField |
getSField(java.lang.String key) |
java.lang.String |
getStringValue(java.lang.String fieldKey) |
java.util.Map<java.lang.String,java.lang.String> |
getStringValueMap() |
java.util.List<SimpleFormSubmissionCallback> |
getSubmissionCallbacks() |
DwTextButton |
getSubmitButton() |
java.lang.Object |
getValue(java.lang.String fieldKey) |
boolean |
isBindingActive() |
boolean |
isField(java.lang.String key) |
boolean |
isFieldsLoaded() |
boolean |
isLoadFieldsOnBinding() |
boolean |
isValid() |
boolean |
isValidateOnSubmit() |
void |
loadFields()
Load all fields.
|
void |
reloadField(java.lang.String fieldKey)
Reloads the field
|
void |
setAction(java.lang.String action) |
void |
setAutoHeight() |
void |
setDiscardLabels(boolean b) |
void |
setEncoding(Encoding encoding) |
void |
setFieldDecorators(java.util.List<SimpleFormFieldDecorator> fieldDecorators) |
void |
setFieldHeight(double height) |
void |
setFieldMarginData(MarginData marginData) |
void |
setFieldWidth(double width)
Sets the width of all form fields added after this method has been called.
|
void |
setFocusOnShow(boolean focusOnShow) |
void |
setHeight(int height) |
void |
setLabelAlign(LabelAlign al) |
void |
setLabelPad(int pad) |
void |
setLabelWidth(int i) |
void |
setLoadFieldsOnBinding(boolean isLoadFieldsOnBinding) |
void |
setMethod(Method method) |
void |
setOldWidget(Widget container) |
void |
setSize(int width,
int height) |
void |
setValidateOnSubmit(boolean validateOnSubmit) |
void |
setValue(java.lang.String key,
java.lang.Object value) |
void |
submit() |
void |
updateFormLayout() |
add, add, add, addClassName, enableScrollContainer, getCssBodyName, getCssContentName, getCssHeaderName, newAccordeonInstance, newHeadlessInstance, newHeadlessInstance, newHeadlessInstance, newInlineInstance, newInlineInstance, newInlineInstance, newLightHeaderPanel, setHeaderIcon, setInfoText, setLightDarkStyle, setLightHeader, setScrollMode, setUrl, setUrl, setWidget
@CssClassConstant public static final java.lang.String CSS_NAME
public void setAutoHeight()
public java.lang.String getCssName()
getCssName
in class DwContentPanel
public static SimpleForm getNewInstance()
public static SimpleForm getInlineInstance()
public static SimpleForm getInlineLabelessInstance()
public void clearButtonBar()
public static Widget createFormlessField(java.lang.Class<?> type, SimpleFormFieldConfiguration... configs)
public Container getFieldWrapper()
public void setDiscardLabels(boolean b)
public void setFieldMarginData(MarginData marginData)
public void setFieldWidth(double width)
width
- the width of all fields added after this method callpublic void setFieldHeight(double height)
public void setLabelAlign(LabelAlign al)
public void addSubmissionCallback(SimpleFormSubmissionCallback cb)
public java.util.List<SimpleFormSubmissionCallback> getSubmissionCallbacks()
public SimpleFormSubmissionCallback getCompositeSubmissionCallback()
public SimpleFormFieldDecorator getFieldDecorator(java.lang.String id)
public <T extends SimpleFormFieldDecorator> T getFieldDecorator(java.lang.Class<? extends T> type, java.lang.String id)
public void addFieldDecorator(SimpleFormFieldDecorator fieldDecorator)
public void setFieldDecorators(java.util.List<SimpleFormFieldDecorator> fieldDecorators)
public java.util.List<SimpleFormFieldDecorator> getFieldDecorators()
public void setLabelPad(int pad)
public void setLabelWidth(int i)
public FormPanel getFormPanel()
public void setFocusOnShow(boolean focusOnShow)
public void addButton(Widget widget)
public ButtonBar getButtonBar()
public DwTextButton addSubmitButton()
public DwTextButton addSubmitButton(java.lang.String txt)
public DwTextButton getSubmitButton()
public void addDependency(java.lang.String dependant, java.lang.String dependsOn)
dependant
- dependsOn
- public void reloadField(java.lang.String fieldKey)
public void addCondition(java.lang.String fieldKey, SimpleFormCondition condition, SimpleFormAction action)
fieldKey
- condition
- action
- public void addCondition(SimpleFormAction action, ComplexCondition... conditions)
action
- conditions
- public <D> void addHidden(java.lang.String name, D value)
public void beginColumn()
public void beginColumn(double width, double height)
public void beginColumn(double width, MarginData marginData)
public void beginColumn(MarginData marginData)
public void beginColumn(double width, double height, MarginData marginData)
public void endColumn()
public void beginRow()
public void beginRow(double width, double height)
public void beginRow(MarginData marginData)
public void beginRow(double width, double height, MarginData marginData)
public void beginFloatRow()
public void beginFloatRow(double width, double height)
public void beginFloatRow(MarginData marginData)
public void beginFloatRow(double width, double height, MarginData marginData)
public void endRow()
public void beginFieldset(java.lang.String label)
public void beginFieldset(double width, double height, java.lang.String label, MarginData marginData)
public void endGroup()
If no group was previously started. method does nothing
public java.lang.String addField(java.lang.Class<?> type, SimpleFormFieldConfiguration... configs)
public java.lang.String addField(java.lang.Class<?> type, java.lang.String label, SimpleFormFieldConfiguration... configs)
public java.lang.String addField(java.lang.Class<?> type, ValueProvider vp, SimpleFormFieldConfiguration... configs)
public java.lang.String addField(java.lang.Class<?> type, ValueProvider vp, java.lang.String label, SimpleFormFieldConfiguration... configs)
public java.lang.String addField(java.lang.Class<?> type, ValueProvider vp, java.lang.String label, java.lang.Object value, SimpleFormFieldConfiguration... configs)
public java.lang.String addField(java.lang.Class<?> type, java.lang.String name, FormFieldLayoutConfiguration fieldLayoutConfig, java.lang.Object value, ValueProvider vp, SimpleFormFieldConfiguration... configs)
public java.lang.String addField(FormFieldProviderHook responsibleHook, java.lang.String name, FormFieldLayoutConfiguration fieldLayoutConfig, java.lang.Object value, ValueProvider vp)
public static FormFieldProviderHook getResponsibleHooker(java.lang.Class<?> type, SimpleFormFieldConfiguration... configs)
public void addFieldMenu(java.lang.String key, Menu menu)
public void addFieldInfo(java.lang.String key, java.lang.String data)
public void addFieldInfo(java.lang.String key, FieldInfoDecorator.DelayedInfoMessage data)
public FormFieldLayoutConfiguration getFieldLayoutConfigFor(java.lang.String key)
public void loadFields()
public Widget getField(java.lang.String fieldKey)
fieldKey
- public Widget getDisplayedField(java.lang.String fieldKey)
public java.util.Collection<java.lang.String> getFieldKeys()
public java.lang.Class<?> getFieldType(java.lang.String fieldKey)
public FormFieldProviderHook getResponsibleHook(java.lang.String fieldKey)
public java.lang.Object getValue(java.lang.String fieldKey)
public void setValue(java.lang.String key, java.lang.Object value)
public java.util.List<SimpleForm.SField> getAllSFields()
public SimpleForm.SField getSField(java.lang.String key)
public boolean isField(java.lang.String key)
public void bind(java.lang.Object model)
model
- public java.lang.Object getBoundModel()
public boolean isBindingActive()
public void addSubmissionListener(SimpleFormSubmissionListener submissionListener)
public boolean isLoadFieldsOnBinding()
public void setLoadFieldsOnBinding(boolean isLoadFieldsOnBinding)
public boolean isFieldsLoaded()
public boolean isValid()
public void clearInvalid()
public void setMethod(Method method)
public void setEncoding(Encoding encoding)
public void setAction(java.lang.String action)
public void submit()
public HandlerRegistration addSubmitCompleteHandler(SubmitCompleteHandler handler)
public void setSize(int width, int height)
public void setHeight(int height)
public HandlerRegistration addValueChangeHandler(java.lang.String key, ValueChangeHandler handler)
public boolean isValidateOnSubmit()
public void setValidateOnSubmit(boolean validateOnSubmit)
public void updateFormLayout()
public void setOldWidget(Widget container)
public Widget getOldWidget()
public static SimpleForm fromJson(java.lang.String formConfig)
public static SimpleForm fromJson(SimpleFormJsonConfig config)
public static FormFieldProviderHook getResponsibleHooker(java.lang.String type, SimpleFormFieldJson config)
public java.lang.String getStringValue(java.lang.String fieldKey)
public java.util.Map<java.lang.String,java.lang.String> getStringValueMap()