Class SimpleInputBuilder<VT>

Object
AbstractInputBuilder<SimpleInputBuilder,VT>
SimpleInputBuilder<VT>

public class SimpleInputBuilder<VT> extends AbstractInputBuilder<SimpleInputBuilder,VT>
Builder class for basic input types.
  • Constructor Details

  • Method Details

    • setDataType

      public SimpleInputBuilder setDataType(String dataType)
      Sets the data type of the input field.
      Possible values: text, float, integer, date, time, datetime, product, customer

      Note: Under standard circumstances, it is not necessary to set the data type using this method – the data type is set by the input builder used in your logic:

      • createUserEntry() - float (BigDecimal) – Set the input as a range and define from and to parameters using the setConfigParamater() method to allow a user to enter only a range of numbers.
      • createIntegerUserEntry() - integer
      • createStringUserEntry() - text
      • createDateTimeUserEntry() - datetime
      • createDateUserEntry() - date
      • createTimeUserEntry() - time
      • createProductEntry - product
      • createCustomerEntry - customer
      Example:
      
       def dateFormat = "yyyy-MM-dd"
       def maxDate = api.parseDate(dateFormat, "2021-10-17")
       def dateEntry = api.inputBuilderFactory()
                            .createUserEntry("date")
                            .setLabel("Date")
                            .setPlaceholderText("date to 2021-10-17")
                            .setDataType("date")
                            .setFormatType(dateFormat)
                            .setTo(maxDate)
                            .buildContextParameter()
       
      Parameters:
      dataType - The type of the data.
      Returns:
      self
    • setFormatType

      public SimpleInputBuilder setFormatType(String formatType)
      Sets the format type of the input field.
      Possible values: COMPLEX, DATE, DATETIME, INTEGER, LINK, MONEY, MONEY_CHF, MONEY_EUR, MONEY_GBP, MONEY_JPY, MONEY_PLN, MONEY_USD, NUMERIC, NUMERIC_LONG, PERCENT, SPARKLINE, TEXT
      Example:
      
       def userEntry = api.inputBuilderFactory()
                      .createUserEntry("Percentage")
                      .setLabel("Percentage")
                      .setPlaceholderText("Value between 35% and 60%")
                      .setFormatType("PERCENT")
                      .setFrom(0.35)
                      .setTo(0.60)
       
      To set the number of displayed decimals, use the following parameter (the number of zeros defines the number of decimal places displayed in the input field): .setFormatType("###.0000")
      Parameters:
      formatType - The format type (see possible values above).
      Returns:
      self
      See Also:
    • setInputType

      public SimpleInputBuilder setInputType(String inputType)
      Sets the input type of the field.
      Example:
      Parameters:
      inputType - Type fo the input, ex. "range"
      Returns:
      self
    • setRounding

      public SimpleInputBuilder setRounding(boolean doRound)
      N/A - the method has not been implemented in the user interface yet.
      Parameters:
      doRound - The rounding mechanism turn on (true) or off (false)
      Returns:
      self
    • setDecimalPlaces

      public SimpleInputBuilder setDecimalPlaces(String mode)
      N/A - the method has not been implemented in the user interface yet.
      Parameters:
      mode - The decimal places of an element to display in the UI
      Returns:
      self
    • setMax

      @Deprecated(since="7.7.0", forRemoval=true) public SimpleInputBuilder setMax(Integer max)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 7.7.0, use instead setTo
      Sets the maximum allowed value for the entry. The property set with this method is 'to'. Please notice that this method only accepts integer values, and no overloaded version of this method that accepts decimals exist. To use decimals, please use the replacement, setTo .
      Parameters:
      max - maximum value
      Returns:
      self
    • setTo

      public SimpleInputBuilder setTo(Float to)
      Sets the maximum allowed value for the input field. When set, a user will not be able to select a higher value than specified by this method. The validation is performed only when the input field value is being entered by a user via the user interface.
      Applicable to the following input types: INTEGERUSERENTRY, USERENTRY
      Example:
      
       def userEntry = api.inputBuilderFactory()
                      .createUserEntry("Percentage")
                      .setLabel("Percentage")
                      .setPlaceholderText("Value between 10% and 20%")
                      .setFormatType("PERCENT")
                      .setFrom(0.1)
                      .setTo(0.2)
       
      Parameters:
      to - The maximum value.
      Returns:
      self
      Since:
      8.0 - Godfather
    • setMax

      @Deprecated(since="7.7.0", forRemoval=true) public SimpleInputBuilder setMax(Date max)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 7.7.0, use instead setTo
      Sets the maximum allowed date value for the entry. The property set with this method is 'to'
      Parameters:
      max - maximum date value
      Returns:
      self
    • setTo

      public SimpleInputBuilder setTo(Date to)
      Sets the maximum allowed date value for the input field. When set, a user will not be able to enter (or select) a higher date than specified by this method. The validation is performed only when the input field value is being entered by a user via the user interface.
      Use together with setFrom(Date) to specify the date range.

      Applicable to the following input types: DATETIMEUSERENTRY (accepts date limits only), DATEUSERENTRY
      Example:

      
       def dateFormat = "yyyy-MM-dd"
       def maxDate = api.parseDate(dateFormat, "2021-10-17")
       def dateEntry = api.inputBuilderFactory()
            .createDateUserEntry("date")
            .setLabel("Date")
            .setPlaceholderText("date to 2021-10-17")
            .setFormatType(dateFormat)
            .setTo(maxDate)
       
      Parameters:
      to - The maximum date.
      Returns:
      self
      Since:
      8.0 - Godfather
    • setMaxLength

      public SimpleInputBuilder setMaxLength(Integer maxLen)
      N/A - the method has not been implemented in the user interface yet.
      Parameters:
      maxLen - The maximum length allowed for the input field.
      Returns:
      self
    • setMin

      @Deprecated(since="7.7.0", forRemoval=true) public SimpleInputBuilder setMin(Integer min)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 7.7.0, use instead setFrom
      Sets the minimum allowed value for the entry. The property set with this method is 'from'. Please notice that this method only accepts integer values, and no overloaded version of this method that accepts decimals exist. To use decimals, please use the replacement, setFrom .
      Parameters:
      min - minimum value
      Returns:
      self
    • setFrom

      public SimpleInputBuilder setFrom(Float from)
      Sets the minimum allowed value for the input field. When set, a user will not be able to select a lower value than specified by this method. The validation is performed only when the input field value is being entered by a user via the user interface.
      Applicable to the following input types: INTEGERUSERENTRY, USERENTRY

      Example:

      
       def userEntry = api.inputBuilderFactory()
                      .createUserEntry("Percentage")
                      .setLabel("Percentage")
                      .setPlaceholderText("Value between 10% and 20%")
                      .setFormatType("PERCENT")
                      .setFrom(0.1)
                      .setTo(0.2)
       
      Parameters:
      from - The minimum value.
      Returns:
      self
      Since:
      8.0 - Godfather
    • setMin

      @Deprecated(since="7.7.0", forRemoval=true) public SimpleInputBuilder setMin(Date min)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 7.7.0, use instead setFrom
      Sets the minimum allowed date value for the entry. The property set with this method is 'from'
      Parameters:
      min - minimum date value
      Returns:
      self
    • setFrom

      public SimpleInputBuilder setFrom(Date from)
      Sets the minimum allowed date value for the input field. When set, a user will not be able to select a lower date than specified by this method. The validation is performed only when the input field value is being entered by a user via the user interface.
      Use together with setTo(Date) to specify the date range.

      Applicable to the following input types: DATETIMEUSERENTRY (accepts date limits only), DATEUSERENTRY

      Example:

      
       def dateFormat = "yyyy-MM-dd"
       def minDate = api.parseDate(dateFormat, "2021-10-02")
       def dateEntry = api.inputBuilderFactory()
            .createDateUserEntry("date")
            .setLabel("Date")
            .setPlaceholderText("date from 2021-10-02")
            .setFormatType(dateFormat)
            .setFrom(minDate)
       
      Parameters:
      from - The minimum date.
      Returns:
      self
      Since:
      8.0 - Godfather
    • setMinLength

      public SimpleInputBuilder setMinLength(Integer minLen)
      N/A - the method has not been implemented in the user interface yet.
      Parameters:
      minLen - The minimum length allowed for the input field.
      Returns:
      self
    • setList

      public SimpleInputBuilder setList(List list)
      N/A - the method has not been implemented in the user interface yet.
      Parameters:
      list - To be defined
      Returns:
      self
    • setRichTextEditor

      public SimpleInputBuilder setRichTextEditor(boolean rte)
      N/A - the method has not been implemented in the user interface yet.
      Parameters:
      rte - true for the usage of RichTextEditor
      Returns:
      self
    • _getInput

      protected Object _getInput()
      Specified by:
      _getInput in class AbstractInputBuilder<SimpleInputBuilder,VT>