Class SimpleForm
ContentPanel
net.datenwerke.gxtdto.client.baseex.widget.DwContentPanel
net.datenwerke.gxtdto.client.forms.simpleform.SimpleForm
- Direct Known Subclasses:
SimpleMultiForm
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class net.datenwerke.gxtdto.client.baseex.widget.DwContentPanel
CSS_BODY_NAME, CSS_CONTENT_NAME, CSS_HEADER_NAME, CSS_LIGHT_DARK, CSS_LIGHT_HEADER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddButton(Widget widget) voidaddCondition(String fieldKey, SimpleFormCondition condition, SimpleFormAction action) Adds a simple condition to the form.voidaddCondition(SimpleFormAction action, ComplexCondition... conditions) Adds a complex condition to the form.voidaddDependency(String dependant, String dependsOn) Triggers a reload whenever the selection of dependsOn changes.addField(Class<?> type, String name, FormFieldLayoutConfiguration fieldLayoutConfig, Object value, ValueProvider vp, SimpleFormFieldConfiguration... configs) Adds a new field to the form.addField(Class<?> type, String label, SimpleFormFieldConfiguration... configs) addField(Class<?> type, SimpleFormFieldConfiguration... configs) addField(Class<?> type, ValueProvider vp, String label, Object value, SimpleFormFieldConfiguration... configs) addField(Class<?> type, ValueProvider vp, String label, SimpleFormFieldConfiguration... configs) addField(Class<?> type, ValueProvider vp, SimpleFormFieldConfiguration... configs) addField(FormFieldProviderHook responsibleHook, String name, FormFieldLayoutConfiguration fieldLayoutConfig, Object value, ValueProvider vp) voidaddFieldDecorator(SimpleFormFieldDecorator fieldDecorator) voidaddFieldInfo(String key, String data) voidvoidaddFieldMenu(String key, Menu menu) <D> voidvoidvoidaddSubmissionListener(SimpleFormSubmissionListener submissionListener) addSubmitButton(String txt) HandlerRegistrationaddSubmitCompleteHandler(SubmitCompleteHandler handler) HandlerRegistrationaddValueChangeHandler(String key, ValueChangeHandler handler) voidvoidbeginColumn(double width, double height) voidbeginColumn(double width, double height, MarginData marginData) voidbeginColumn(double width, MarginData marginData) voidbeginColumn(MarginData marginData) voidbeginFieldset(double width, double height, String label, MarginData marginData) voidbeginFieldset(String label) Starts a new field groupvoidvoidbeginFloatRow(double width, double height) voidbeginFloatRow(double width, double height, MarginData marginData) voidbeginFloatRow(MarginData marginData) voidbeginRow()voidbeginRow(double width, double height) voidbeginRow(double width, double height, MarginData marginData) voidbeginRow(MarginData marginData) voidAllows to issue a form bindingvoidvoidstatic WidgetcreateFormlessField(Class<?> type, SimpleFormFieldConfiguration... configs) voidvoidendGroup()Ends the current group.voidendRow()static SimpleFormstatic SimpleFormfromJson(SimpleFormJsonConfig config) ButtonBarRetrieves the cancel button for the form.WidgetgetDisplayedField(String fieldKey) WidgetReturns the field identified by fieldKey.<T extends SimpleFormFieldDecorator>
TgetFieldDecorator(Class<? extends T> type, String id) Class<?> getFieldType(String fieldKey) ContainerFormPanelstatic SimpleFormstatic SimpleFormstatic SimpleFormWidgetgetResponsibleHook(String fieldKey) static FormFieldProviderHookgetResponsibleHooker(Class<?> type, SimpleFormFieldConfiguration... configs) static FormFieldProviderHookgetResponsibleHooker(String type, SimpleFormFieldJson config) getStringValue(String fieldKey) booleanbooleanbooleanbooleanbooleanisValid()booleanvoidLoad all fields.voidonCancel()This method is executed when a cancel action is triggered.voidreloadField(String fieldKey) Reloads the fieldvoidThis method reloads the form by clearing, resetting, and reloading its associated fields, bindings, and other configurations.voidvoidvoidsetDiscardLabels(boolean b) voidsetEncoding(Encoding encoding) voidsetFieldDecorators(List<SimpleFormFieldDecorator> fieldDecorators) voidsetFieldHeight(double height) voidsetFieldMarginData(MarginData marginData) voidsetFieldWidth(double width) Sets the width of all form fields added after this method has been called.voidsetFocusOnShow(boolean focusOnShow) voidsetHeight(int height) voidsetLabelAlign(LabelAlign al) voidsetLabelPad(int pad) voidsetLabelWidth(int i) voidsetLoadFieldsOnBinding(boolean isLoadFieldsOnBinding) voidsetMethod(Method method) voidsetOldWidget(Widget container) voidsetSize(int width, int height) voidsetValidateOnSubmit(boolean validateOnSubmit) voidvoidsubmit()voidMethods inherited from class net.datenwerke.gxtdto.client.baseex.widget.DwContentPanel
add, add, add, addClassName, enableScrollContainer, getCssBodyName, getCssContentName, getCssHeaderName, newAccordeonInstance, newHeadlessInstance, newHeadlessInstance, newHeadlessInstance, newInlineInstance, newInlineInstance, newInlineInstance, newLightHeaderPanel, setHeaderIcon, setInfoText, setLightDarkStyle, setLightHeader, setScrollMode, setUrl, setUrl, setWidget
-
Field Details
-
CSS_NAME
- See Also:
-
-
Constructor Details
-
SimpleForm
public SimpleForm()
-
-
Method Details
-
setAutoHeight
public void setAutoHeight() -
getCssName
- Overrides:
getCssNamein classDwContentPanel
-
getNewInstance
-
getInlineInstance
-
getInlineLabelessInstance
-
clearButtonBar
public void clearButtonBar() -
createFormlessField
-
getFieldWrapper
public Container getFieldWrapper() -
setDiscardLabels
public void setDiscardLabels(boolean b) -
setFieldMarginData
public void setFieldMarginData(MarginData marginData) -
setFieldWidth
public void setFieldWidth(double width) Sets the width of all form fields added after this method has been called.- Parameters:
width- the width of all fields added after this method call
-
setFieldHeight
public void setFieldHeight(double height) -
setLabelAlign
public void setLabelAlign(LabelAlign al) -
addSubmissionCallback
-
getSubmissionCallbacks
-
getCompositeSubmissionCallback
-
getFieldDecorator
-
getFieldDecorator
-
addFieldDecorator
-
setFieldDecorators
-
getFieldDecorators
-
setLabelPad
public void setLabelPad(int pad) -
setLabelWidth
public void setLabelWidth(int i) -
getFormPanel
public FormPanel getFormPanel() -
setFocusOnShow
public void setFocusOnShow(boolean focusOnShow) -
addButton
public void addButton(Widget widget) -
getButtonBar
public ButtonBar getButtonBar() -
addSubmitButton
-
addSubmitButton
-
getSubmitButton
-
addDependency
Triggers a reload whenever the selection of dependsOn changes.- Parameters:
dependant-dependsOn-
-
reloadField
Reloads the field -
addCondition
Adds a simple condition to the form.- Parameters:
fieldKey-condition-action-
-
addCondition
Adds a complex condition to the form.- Parameters:
action-conditions-
-
addHidden
-
beginColumn
public void beginColumn() -
beginColumn
public void beginColumn(double width, double height) -
beginColumn
public void beginColumn(double width, MarginData marginData) -
beginColumn
public void beginColumn(MarginData marginData) -
beginColumn
public void beginColumn(double width, double height, MarginData marginData) -
endColumn
public void endColumn() -
beginRow
public void beginRow() -
beginRow
public void beginRow(double width, double height) -
beginRow
public void beginRow(MarginData marginData) -
beginRow
public void beginRow(double width, double height, MarginData marginData) -
beginFloatRow
public void beginFloatRow() -
beginFloatRow
public void beginFloatRow(double width, double height) -
beginFloatRow
public void beginFloatRow(MarginData marginData) -
beginFloatRow
public void beginFloatRow(double width, double height, MarginData marginData) -
endRow
public void endRow() -
beginFieldset
Starts a new field group -
beginFieldset
-
endGroup
public void endGroup()Ends the current group.If no group was previously started. method does nothing
-
addField
-
addField
-
addField
-
addField
public String addField(Class<?> type, ValueProvider vp, String label, SimpleFormFieldConfiguration... configs) -
addField
public String addField(Class<?> type, ValueProvider vp, String label, Object value, SimpleFormFieldConfiguration... configs) -
addField
public String addField(Class<?> type, String name, FormFieldLayoutConfiguration fieldLayoutConfig, Object value, ValueProvider vp, SimpleFormFieldConfiguration... configs) Adds a new field to the form. -
addField
public String addField(FormFieldProviderHook responsibleHook, String name, FormFieldLayoutConfiguration fieldLayoutConfig, Object value, ValueProvider vp) -
getResponsibleHooker
public static FormFieldProviderHook getResponsibleHooker(Class<?> type, SimpleFormFieldConfiguration... configs) -
addFieldMenu
-
addFieldInfo
-
addFieldInfo
-
getFieldLayoutConfigFor
-
loadFields
public void loadFields()Load all fields. -
getField
Returns the field identified by fieldKey.- Parameters:
fieldKey-
-
getDisplayedField
-
getFieldKeys
-
getFieldType
-
getResponsibleHook
-
getValue
-
setValue
-
getAllSFields
-
getSField
-
isField
-
bind
Allows to issue a form binding- Parameters:
model-
-
getBoundModel
-
isBindingActive
public boolean isBindingActive() -
addSubmissionListener
-
isLoadFieldsOnBinding
public boolean isLoadFieldsOnBinding() -
setLoadFieldsOnBinding
public void setLoadFieldsOnBinding(boolean isLoadFieldsOnBinding) -
isFieldsLoaded
public boolean isFieldsLoaded() -
isValid
public boolean isValid() -
clearInvalid
public void clearInvalid() -
setMethod
public void setMethod(Method method) -
setEncoding
public void setEncoding(Encoding encoding) -
setAction
-
submit
public void submit() -
addSubmitCompleteHandler
public HandlerRegistration addSubmitCompleteHandler(SubmitCompleteHandler handler) -
setSize
public void setSize(int width, int height) -
setHeight
public void setHeight(int height) -
addValueChangeHandler
-
isValidateOnSubmit
public boolean isValidateOnSubmit() -
setValidateOnSubmit
public void setValidateOnSubmit(boolean validateOnSubmit) -
updateFormLayout
public void updateFormLayout() -
setOldWidget
public void setOldWidget(Widget container) -
getOldWidget
public Widget getOldWidget() -
fromJson
-
fromJson
-
getResponsibleHooker
-
getStringValue
-
getStringValueMap
-
getCancelButton
Retrieves the cancel button for the form. If the button has not been created yet, it initializes a new button with the appropriate icon and label.- Returns:
- the cancel button as a DwTextButton instance
-
onCancel
public void onCancel()This method is executed when a cancel action is triggered. It performs the following operations: 1. Removes the mask or overlay from the current user interface to enable user interaction. 2. Reloads the form to reset its state or refresh its content. -
reloadForm
public void reloadForm()This method reloads the form by clearing, resetting, and reloading its associated fields, bindings, and other configurations. It handles the cleanup of existing field bindings, resets field widgets and containers to their default state, and restores the form layout and actions. Key actions performed by this method: 1. If binding is active, it removes the current field bindings for all fields. 2. Clears the field wrapper and resets the layout stack. 3. Resets all fields, including their associated display fields, widgets, and containers. 4. Reloads the form's fields based on the current application state. - If binding is active, it re-binds fields. - Otherwise, it loads fields individually, along with conditions and dependencies. 5. Restores header actions. 6. Ensures the layout is updated and enforced after the reload. It handles exceptions that may occur during the unbinding process but ensures that the form's state is correctly updated upon completion of the reloading process.
-