Interface Dependent<D extends Dependent<D>>

All Superinterfaces:
Comparable<D>, Component<D>, Copyable<D>, FormComponent<D>, Serializable
All Known Subinterfaces:
ExportHistoryGridExternal<E>, GridExternal<E>, LookupField<F>
All Known Implementing Classes:
DefaultExportHistoryGridExternal, DefaultGridExternal, DefaultLookupField

public interface Dependent<D extends Dependent<D>> extends FormComponent<D>
Represents metadata for a FormComponent that has dependencies on its parent form's state.

Generally, this is used by form components like GridExternal or LookupField in order to indicate which of the parent's properties they need to retrieve data. Additionally, if a dependent field is specified, it is expected the dependent component will refresh it's data upon detecting a change in the dependency.

Author:
Nick Crum (ncrum)
  • Method Details

    • dependentField

      default D dependentField(String... dependentFieldsToAdd)
      Adds a dependency on the provided field name(s).

      Specifying a field as a dependency makes it available as a context parameter for the endpoint URL. Only fields targeted as a dependency can be referenced using the `${parent.}` syntax.

      Additionally, changes to dependencies will cause the refresh of the data for a dependent.

      Parameters:
      dependentFieldsToAdd - the fields to add
      Returns:
      the component
    • dependentFields

      default D dependentFields(Collection<String> dependentFieldsToAdd)
      Adds a dependency on the provided field name(s).

      Specifying a field as a dependency makes it available as a context parameter for the endpoint URL. Only fields targeted as a dependency can be referenced using the `${parent.}` syntax.

      Additionally, changes to dependencies will cause the refresh of the data for a dependent.

      Parameters:
      dependentFieldsToAdd - the fields to add
      Returns:
      the component
    • clearDependentFields

      default D clearDependentFields()
      Clears any dependent fields.
      Returns:
      the component
    • parentIdField

      default D parentIdField(String parentIdField)
      Define the property on the parent specifying it's unique identifier.

      This defaults to "id" in the client and is always included as a dependency.

      Parameters:
      parentIdField - the parent id field
      Returns:
      the component