Class HtmlField

java.lang.Object
jp.ecuacion.splib.web.bean.HtmlField
Direct Known Subclasses:
HtmlFieldNumber, HtmlFieldString

public class HtmlField extends Object
Stores attributes of each html component which controls the behiviors of it in html pages.

It is named with "field" because it's name is defined in the "field" format like mailAddress, not like acc.mailAddress.

  • Field Details

    • id

      @Nonnull protected String id
      Is an ID which the root record name plus dot (like "acc.") is removed from the itemId.

      When you treat the field in the record belonging to the root record, you need to define it like childRecord.childFieldName.

      It is required if you construct this class.

    • displayNameId

      protected String displayNameId
      Is an ID to the display name of the field.

      The display name can be obtained by referring item_names.properties with it.

    • isNotEmpty

      Shows whether the field allows empty.

      When this value is true, required validation is executed on server side, and shows "required" mark on the component in the html page.

      It doesn't depend on the data type.

      The default value is preset: false. So the value becomes false if you don't have to set this value.

  • Constructor Details

    • HtmlField

      public HtmlField(String id)
      Constructs a new instance with ID.
      Parameters:
      id - fieldId
  • Method Details

    • getId

      public String getId()
    • displayNameId

      public HtmlField displayNameId(String displayNameId)
      Sets displayNameId and returns this for method chain.
      Parameters:
      displayNameId - displayNameId
      Returns:
      HtmlField
    • getDisplayNameId

      public String getDisplayNameId()
      Returns displayNameId value.

      Its value is null means the item's original itemId is equal to displayNameId.

      Returns:
      displayNameId
    • isNotEmpty

      public HtmlField isNotEmpty(boolean isNotEmpty)
      Sets isNotEmpty.

      Set true when you want to the item is required.

      Parameters:
      isNotEmpty - isNotEmpty
      Returns:
      HtmlField
    • isNotEmpty

      public HtmlField isNotEmpty(HtmlField.HtmlFieldConditionKeyEnum authKind, String authString, boolean isNotEmpty)
      Sets isNotEmpty with the conditions of HtmlFieldConditionKeyEnum, authString.

      When you set multiple conditions to it, the order matters. First condition prioritized.

      Parameters:
      authKind - authKind
      authString - authString
      isNotEmpty - isNotEmpty
      Returns:
      HtmlField
    • getIsNotEmpty

      public boolean getIsNotEmpty(String loginState, SplibSecurityUtil.RolesAndAuthoritiesBean bean)
      Obtains isNotEmpty.
      Parameters:
      loginState - loginState
      bean - bean
      Returns:
      boolean