Class FormMeta

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<FormMeta>

    public class FormMeta
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<FormMeta>
    This class encapsulates all of the additional information that we add to each persistent field so that we can automatically create web UIs that deal with the fields.
    See Also:
    Serialized Form
    • Field Detail

      • fieldNameKey

        protected java.lang.String fieldNameKey
      • fieldDescriptionKey

        protected java.lang.String fieldDescriptionKey
      • fieldDescriptionKeyAddMode

        protected java.lang.String fieldDescriptionKeyAddMode
      • fieldDescriptionKeyEditMode

        protected java.lang.String fieldDescriptionKeyEditMode
      • showDefault

        protected boolean showDefault
        Whether or not the field's default value should be shown on an add/edit screen
      • visible

        protected boolean visible
        Controls whether or not the field is visible on an add/edit screen
      • enabled

        protected boolean enabled
        Controls whether or not the field, if visible, is enabled on an add/edit screen
      • required

        protected boolean required
        alternate required method. see setter docs.
      • escapeHtmlOnDisplay

        protected boolean escapeHtmlOnDisplay
        Whether or not the value of this field should be escaped when displayed.
      • fieldOrder

        protected int fieldOrder
        The relative order (within this field's category) that the field should appear. Lower numbers appear first. Set automatically based on the order that the field is added to the category.
      • validators

        protected java.util.List<org.apache.wicket.validation.IValidator> validators
        A list of wicket validators that should be applied to the field
      • category

        protected Category category
        The category that the field belongs to.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • addValidator

        public FormMeta addValidator​(org.apache.wicket.validation.IValidator validator)
      • getValidators

        public java.util.List<org.apache.wicket.validation.IValidator> getValidators()
      • isVisible

        public boolean isVisible()
      • setVisible

        public FormMeta setVisible​(boolean visible)
      • isRequired

        public boolean isRequired()
      • setRequired

        public FormMeta setRequired​(boolean required)
        Normally, a field is marked as required by using the SMANDATORY field flag. But sometimes we can't use that flag because it adds a NOT_NULL constraint to the DB, which isn't acceptable for legacy reasons, and so a field can set this flag on the FormMeta in order to still have the UI treat the field as required.
      • getCategory

        public Category getCategory()
      • setCategory

        public FormMeta setCategory​(java.lang.String displayKey,
                                    int order)
      • getFieldOrder

        public int getFieldOrder()
      • setFieldOrder

        public FormMeta setFieldOrder​(int fieldOrder)
      • getFieldNameKey

        public java.lang.String getFieldNameKey()
      • setFieldNameKey

        public FormMeta setFieldNameKey​(java.lang.String fieldNameKey)
      • getFieldDescriptionKey

        public java.lang.String getFieldDescriptionKey()
      • setFieldDescriptionKey

        public FormMeta setFieldDescriptionKey​(java.lang.String fieldDescriptionKey)
      • getExtendedDescription

        public org.apache.wicket.model.IModel getExtendedDescription​(SRecordInstance record)
        Provided for subclasses to have custom logic to look up any record-specific instructions for a field
      • newEditorComponent

        public org.apache.wicket.Component newEditorComponent​(java.lang.String id,
                                                              RecordEditMode mode,
                                                              SRecordInstance record)
      • isShowDefault

        public boolean isShowDefault()
      • setShowDefault

        public FormMeta setShowDefault​(boolean showDefault)
      • installValidators

        public org.apache.wicket.markup.html.form.FormComponent installValidators​(org.apache.wicket.markup.html.form.FormComponent c)
      • compareTo

        public int compareTo​(FormMeta o)
        Specified by:
        compareTo in interface java.lang.Comparable<FormMeta>
      • getFieldDescriptionKeyAddMode

        public java.lang.String getFieldDescriptionKeyAddMode()
      • setFieldDescriptionKeyAddMode

        public FormMeta setFieldDescriptionKeyAddMode​(java.lang.String fieldDescriptionKeyAddMode)
      • getFieldDescriptionKeyEditMode

        public java.lang.String getFieldDescriptionKeyEditMode()
      • setFieldDescriptionKeyEditMode

        public FormMeta setFieldDescriptionKeyEditMode​(java.lang.String fieldDescriptionKeyEditMode)
      • isEnabled

        public boolean isEnabled()
      • setEnabled

        public FormMeta setEnabled​(boolean enabled)
      • isEscapeHTMLOnDisplay

        public boolean isEscapeHTMLOnDisplay()
      • setEscapeHTMLOnDisplay

        public FormMeta setEscapeHTMLOnDisplay​(boolean escapeHtmlOnDisplay)