Class FormChangedEvent

java.lang.Object
com.jbstrap.core.event.BaseEvent
com.jbstrap.core.event.FormChangedEvent

public class FormChangedEvent extends BaseEvent
This class contains the data of the Form changed event. These are the following:
  • The client on which the event occurred
  • The ID of the component on which the event occurred
  • The event type
  • The instance of the component, on which the event occurred
  • The event's unique ID
  • The changed form component's ID
  • The changed Form instance
  • The changed form item instance
  • The form's full data content as a Map
Since:
4.0
Author:
JBStrap
  • Constructor Details

    • FormChangedEvent

      public FormChangedEvent()
  • Method Details

    • getChangedFormItemId

      public String getChangedFormItemId()
      Gets the changed form item's ID
      Returns:
      The changed form item's ID
    • getChangedFormItem

      public FormItem<?,?> getChangedFormItem()
      Gets the changed form item
      Returns:
      The changed form item instance or null if the form change isn't triggered by a form item. One such case could be, if a form got a record to display, or if the form is opening a new record. In this case, the form item changes, thus the changed form item cannot be defined, and the method will return with null
    • getFields

      public Map<String,Object> getFields()
      Gets a map of changed form data
      Returns:
      The form's data contents in a Map. The Map key is the form field name, and the value will be the form field value. This map will only contain data that are displayed on the form. It will not contain the added, but not displayed data.
    • get

      public <T> T get(String fieldName)
      Gets a displayed form data, that is specified by the field name.
      Type Parameters:
      T - The data type
      Parameters:
      fieldName - The name of the form field
      Returns:
      The form field contents or null if the specified field is not displayed on the form
    • fireEvent

      public void fireEvent()
      Specified by:
      fireEvent in class BaseEvent