ContentPanel
net.datenwerke.gxtdto.client.baseex.widget.DwContentPanel
net.datenwerke.gxtdto.client.forms.simpleform.SimpleForm
Direct Known Subclasses:
SimpleMultiForm

public class SimpleForm extends DwContentPanel
  • Field Details

  • Constructor Details

    • SimpleForm

      public SimpleForm()
  • Method Details

    • setAutoHeight

      public void setAutoHeight()
    • getCssName

      public String getCssName()
      Overrides:
      getCssName in class DwContentPanel
    • getNewInstance

      public static SimpleForm getNewInstance()
    • getInlineInstance

      public static SimpleForm getInlineInstance()
    • getInlineLabelessInstance

      public static SimpleForm getInlineLabelessInstance()
    • clearButtonBar

      public void clearButtonBar()
    • createFormlessField

      public static Widget createFormlessField(Class<?> type, SimpleFormFieldConfiguration... configs)
    • 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

      public void addSubmissionCallback(SimpleFormSubmissionCallback cb)
    • getSubmissionCallbacks

      public List<SimpleFormSubmissionCallback> getSubmissionCallbacks()
    • getCompositeSubmissionCallback

      public SimpleFormSubmissionCallback getCompositeSubmissionCallback()
    • getFieldDecorator

      public SimpleFormFieldDecorator getFieldDecorator(String id)
    • getFieldDecorator

      public <T extends SimpleFormFieldDecorator> T getFieldDecorator(Class<? extends T> type, String id)
    • addFieldDecorator

      public void addFieldDecorator(SimpleFormFieldDecorator fieldDecorator)
    • setFieldDecorators

      public void setFieldDecorators(List<SimpleFormFieldDecorator> fieldDecorators)
    • getFieldDecorators

      public List<SimpleFormFieldDecorator> 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

      public DwTextButton addSubmitButton()
    • addSubmitButton

      public DwTextButton addSubmitButton(String txt)
    • getSubmitButton

      public DwTextButton getSubmitButton()
    • addDependency

      public void addDependency(String dependant, String dependsOn)
      Triggers a reload whenever the selection of dependsOn changes.
      Parameters:
      dependant -
      dependsOn -
    • reloadField

      public void reloadField(String fieldKey)
      Reloads the field
    • addCondition

      public void addCondition(String fieldKey, SimpleFormCondition condition, SimpleFormAction action)
      Adds a simple condition to the form.
      Parameters:
      fieldKey -
      condition -
      action -
    • addCondition

      public void addCondition(SimpleFormAction action, ComplexCondition... conditions)
      Adds a complex condition to the form.
      Parameters:
      action -
      conditions -
    • addHidden

      public <D> void addHidden(String name, D value)
    • 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

      public void beginFieldset(String label)
      Starts a new field group
    • beginFieldset

      public void beginFieldset(double width, double height, String label, MarginData marginData)
    • endGroup

      public void endGroup()
      Ends the current group.

      If no group was previously started. method does nothing

    • addField

      public String addField(Class<?> type, SimpleFormFieldConfiguration... configs)
    • addField

      public String addField(Class<?> type, String label, SimpleFormFieldConfiguration... configs)
    • addField

      public String addField(Class<?> type, ValueProvider vp, SimpleFormFieldConfiguration... configs)
    • 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

      public void addFieldMenu(String key, Menu menu)
    • addFieldInfo

      public void addFieldInfo(String key, String data)
    • addFieldInfo

      public void addFieldInfo(String key, FieldInfoDecorator.DelayedInfoMessage data)
    • getFieldLayoutConfigFor

      public FormFieldLayoutConfiguration getFieldLayoutConfigFor(String key)
    • loadFields

      public void loadFields()
      Load all fields.
    • getField

      public Widget getField(String fieldKey)
      Returns the field identified by fieldKey.
      Parameters:
      fieldKey -
    • getDisplayedField

      public Widget getDisplayedField(String fieldKey)
    • getFieldKeys

      public Collection<String> getFieldKeys()
    • getFieldType

      public Class<?> getFieldType(String fieldKey)
    • getResponsibleHook

      public FormFieldProviderHook getResponsibleHook(String fieldKey)
    • getValue

      public Object getValue(String fieldKey)
    • setValue

      public void setValue(String key, Object value)
    • getAllSFields

      public List<SimpleForm.SField> getAllSFields()
    • getSField

      public SimpleForm.SField getSField(String key)
    • isField

      public boolean isField(String key)
    • bind

      public void bind(Object model)
      Allows to issue a form binding
      Parameters:
      model -
    • getBoundModel

      public Object getBoundModel()
    • isBindingActive

      public boolean isBindingActive()
    • addSubmissionListener

      public void addSubmissionListener(SimpleFormSubmissionListener submissionListener)
    • 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

      public void setAction(String action)
    • 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

      public HandlerRegistration addValueChangeHandler(String key, ValueChangeHandler handler)
    • 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

      public static SimpleForm fromJson(String formConfig)
    • fromJson

      public static SimpleForm fromJson(SimpleFormJsonConfig config)
    • getResponsibleHooker

      public static FormFieldProviderHook getResponsibleHooker(String type, SimpleFormFieldJson config)
    • getStringValue

      public String getStringValue(String fieldKey)
    • getStringValueMap

      public Map<String,String> getStringValueMap()
    • getCancelButton

      public DwTextButton 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.