Class ConfiguratorTableInputBuilder


public class ConfiguratorTableInputBuilder extends AbstractInputBuilder<ConfiguratorTableInputBuilder,Object>
  • Constructor Details

    • ConfiguratorTableInputBuilder

      public ConfiguratorTableInputBuilder(InputBuilderContext builderContext, String paramName)
  • Method Details

    • _getInput

      protected Object _getInput()
      Specified by:
      _getInput in class AbstractInputBuilder<ConfiguratorTableInputBuilder,Object>
    • setColumns

      public ConfiguratorTableInputBuilder setColumns(List<Map> columns)

      Adds specified columns to the Configurator table.

      Example – adds the configurator table with two columns on the Quote Header:
      
       def columns = [
           [name: 'Date', label: 'Date', type: 'DATE'],
           [name: 'Datetime', label: 'Datetime', type: 'DATETIME'],
           [name: 'Integer', label: 'Integer', type: 'INTEGER'],
           [name: 'Link', label: 'Link', type: 'LINK'],
           [name: 'Money', label: 'Money', type: 'MONEY'],
           [name: 'MoneyEUR', label: 'Money EUR', type: 'MONEY_EUR'],
           [name: 'Numeric', label: 'Numeric', type: 'NUMERIC'],
           [name: 'NumericLong', label: 'Numeric Long', type: 'NUMERIC_LONG'],
           [name: 'Percent', label: 'Percent', type: 'PERCENT'],
           [name: 'String', label: 'String', type: 'TEXT'],
           [name: 'Product', label: 'Product', type: 'TEXT'],
           [name: 'Customer', label: 'Customer', type: 'TEXT'],
       ]
      
       def ct = api.inputBuilderFactory()
            .createConfiguratorTable("ConfiguratorTable")
            .setColumns(columns)
            .buildMap()
      
       quoteProcessor.addOrUpdateInput(ct)
      
       return ct
       
      Parameters:
      columns - A list of maps representing definitions of ConfiguratorTable columns.
      Returns:
      the current instance of ConfiguratorTableInputBuilder
      Since:
      11.0 Paper plane
    • setDimensions

      public ConfiguratorTableInputBuilder setDimensions(String width, String height)
      Sets particular dimensions of the modal dialog (Configurator) that is opened when a user clicks the Add button below the ConfiguratorTable.

      Example:

      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable("ConfiguratorTableName")
           .setColumns(columns)
           .setDimensions("300", "800")
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      width - width value as a String
      height - height value as a String
      Returns:
      the current instance of ConfiguratorTableInputBuilder
    • withEnableClientFilter

      public ConfiguratorTableInputBuilder withEnableClientFilter(boolean enableClientFilter)
      Allows a user to filter the table by row values.
      Default = true (the filtering is enabled).

      Example:

      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable("ConfiguratorTableName")
           .setColumns(columns)
           .withEnableClientFilter(false)
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      enableClientFilter - Set to false to disable filtering.
      Returns:
      the current instance of ConfiguratorTableInputBuilder
    • setEnableClientFilter

      public ConfiguratorTableInputBuilder setEnableClientFilter(boolean enableClientFilter)
      Allows a user to filter the table by row values.
      Default = true (the filtering is enabled).

      Example:

      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable('ConfiguratorTableName')
           .setColumns(columns)
           .withEnableClientFilter(false)
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      enableClientFilter - Set to false to disable filtering.
      Returns:
      the current instance of ConfiguratorTableInputBuilder
    • withEnableAdvancedFilter

      public ConfiguratorTableInputBuilder withEnableAdvancedFilter(boolean enableAdvancedFilter)
      Enabling the advanced filter functionality. Default = true (the filtering is enabled).

      Example:

      
       def configuratorTable = api.inputBuilderFactory()
           .createConfiguratorTable('ConfiguratorTableName')
           .setColumns(columns)
           .withEnableAdvancedFilter(false)
           .withRowTypes(rowTypes)
           .buildContextParameter()
      
       def configuratorEntry = api.createConfiguratorEntry()
      
       configuratorEntry.createParameter(configuratorTable)
      
       return configuratorEntry
       
      Parameters:
      enableAdvancedFilter - Set to false to disable filtering.
      Returns:
      the current instance of ConfiguratorTableInputBuilder
      Since:
      13.0 - Rampur
      See Also:
    • setEnableAdvancedFilter

      public ConfiguratorTableInputBuilder setEnableAdvancedFilter(boolean enableAdvancedFilter)
      Enabling the advanced filter functionality. Default = true (the filtering is enabled).

      Example:

      
       def configuratorTable = api.inputBuilderFactory()
           .createConfiguratorTable('ConfiguratorTableName')
           .setColumns(columns)
           .setEnableAdvancedFilter(false)
           .setLabel('Configurator Table')
           .buildContextParameter()
      
       def configuratorEntry = api.createConfiguratorEntry()
      
       configuratorEntry.createParameter(configuratorTable)
      
       return configuratorEntry
       
      Parameters:
      enableAdvancedFilter - Set to false to disable filtering.
      Returns:
      the current instance of ConfiguratorTableInputBuilder
      Since:
      13.0 - Rampur
      See Also:
    • withEnableEditActions

      public ConfiguratorTableInputBuilder withEnableEditActions(boolean enableEditActions)
      Allows a user to edit values in the table.
      Default = true (the editing is enabled).

      Example:

      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable("ConfiguratorTableName")
           .setColumns(columns)
           .withEnableEditActions(false)
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      enableEditActions - Set to false to disable editing.
      Returns:
      the current instance of ConfiguratorTableInputBuilder
    • withEnableAddActions

      public ConfiguratorTableInputBuilder withEnableAddActions(boolean enableAddActions)
      Allows you to disable adding new rows to a table within a Configurator – the 'Add' button will be hidden when enableAddActions is set to false. Adding new rows is enabled (true) by default. This method enables or disables adding rows globally for the current ConfiguratorTable.
      Adding an individual row can be enabled or disabled using the allowAdd flag within the row type (see withRowTypes(List)) – which is not possible when adding new rows is disabled globally (enableAddActions=false).

      Example:

      
       def columns = [[name: 'Product',  label: 'Product',  type: 'TEXT'],
                      [name: 'Customer', label: 'Customer', type: 'TEXT'],
                      [name: 'Feature',  label: 'Feature',  type: 'TEXT']]
      
       def rowTypes = [[label: 'addProduct',  url: "URL_formula_ProductConfigurator"],
                       [label: 'addCustomer', url: "URL_formula_CustomerConfigurator", allowAdd: false],
                       [label: 'addFeature',  url: "URL_formula_FeatureConfigurator",  allowAdd: true]]
      
       def contextParameter = api.inputBuilderFactory()
              .createConfiguratorTable("ConfiguratorTableName")
              .setColumns(columns)
              .withRowTypes(rowTypes)      //only 'addProduct' and 'addFeature' will be possible to add
              .withEnableAddActions(true)  //can be omitted in this scenario, as true is default
              .buildContextParameter()
      
       def configuratorEntry = api.createConfiguratorEntry()
      
       configuratorEntry.createParameter(contextParameter)
      
       return configuratorEntry
       
      Parameters:
      enableAddActions - Set to false to turn off the 'Add' button visibility.
      Returns:
      the current instance of ConfiguratorTableInputBuilder
      Since:
      13.0 - Rampur
      See Also:
    • withEnableDuplicateActions

      public ConfiguratorTableInputBuilder withEnableDuplicateActions(boolean enableDuplicateActions)
      Allows a user to duplicate table rows.
      Default = true (duplicating a row is enabled).

      Example:

      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable("ConfiguratorTableName")
           .setColumns(columns)
           .withEnableDuplicateActions(false)
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      enableDuplicateActions -
      Returns:
      the current instance of ConfiguratorTableInputBuilder
    • withEnableDeleteActions

      public ConfiguratorTableInputBuilder withEnableDeleteActions(boolean enableDeleteActions)
      Allows a user to delete table rows.
      Default = true (deleting is enabled).

      Example:

      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable("ConfiguratorTableName")
           .setColumns(columns)
           .withEnableDeleteActions(false)
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      enableDeleteActions -
      Returns:
      the current instance of ConfiguratorTableInputBuilder
    • withRowTypes

      public ConfiguratorTableInputBuilder withRowTypes(List<Object> rowTypes)
      Specifies row types that can be added to the ConfiguratorTable when a user clicks the 'Add' button to add a row.
      Row types are specified by a list of maps, where each map contains the label and url parameters. Use the uniqueName of the Configurator logic as the url parameter.
      You can also control whether a particular row type can be added by a user by defining the allowAdd flag within each map.
      Note: To disable adding rows to the ConfiguratorTable globally, refer to withEnableAddActions(boolean).

      Example:

      
       def columns = [
           [name: 'product', label: 'Product', type: 'TEXT'],
           [name: 'customer', label: 'Customer', type: 'TEXT']
      
       def rowTypes = [
           [label: 'addProduct', url: 'ProductConfigurator', allowAdd: true],
           [label: 'addCustomer', url: 'CustomerConfigurator', allowAdd: false] // this row type cannot be added by the user
       ]
      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable("ConfiguratorTableName")
           .setColumns(columns)
           .setDefaultHeight(500)
           .setFixTableHeight(true)
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      rowTypes - A list of maps, each map representing a row type with label and url parameters, and optionally an allowAdd boolean to control the row type visibility in the 'Add' drop-down menu.
      Returns:
      The current instance of ConfiguratorTableInputBuilder
      See Also:
    • setDefaultHeight

      public ConfiguratorTableInputBuilder setDefaultHeight(int value)
      Sets the maximum table height. If there are more entries than the defined default height the scroll bar appears.
      Note: setFixTableHeight(boolean) must be set to true to allow the height setting used by setDefaultHeight method.

      Example:

      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable("ConfiguratorTableName")
           .setColumns(columns)
           .setDefaultHeight(500)
           .setFixTableHeight(true)
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      value - height (in pixels)
      Returns:
      the current instance of ConfiguratorTableInputBuilder
    • setFitFieldWidths

      public ConfiguratorTableInputBuilder setFitFieldWidths(boolean value)

      Sets whether fields (table cells) should autofit widths to title texts or the content.

      Example:
      
        def ct = api.inputBuilderFactory()
            .createConfiguratorTable("ConfiguratorTableName")
            .setColumns(columns)
            .withRowTypes(rowTypes)
            .setLabel("Configurator Table")
            .setFitFieldWidths(true)
            .buildContextParameter()
      
        def ce = api.createConfiguratorEntry()
      
        ce.createParameter(ct)
      
        return ce
       
      Parameters:
      value - true to enable, false to disable fit field width
      Returns:
      self
      Since:
      12.0 - Clover Club
    • setFixTableHeight

      public ConfiguratorTableInputBuilder setFixTableHeight(boolean value)
      Allows setting the table height using the setDefaultHeight(int) method.
      Default = false

      Example:

      
       def ct = api.inputBuilderFactory()
           .createConfiguratorTable("ConfiguratorTableName")
           .setColumns(columns)
           .setDefaultHeight(500)
           .setFixTableHeight(true)
           .withRowTypes(rowTypes)
           .setLabel("Configurator Table")
           .buildContextParameter()
      
       def ce = api.createConfiguratorEntry()
      
       ce.createParameter(ct)
      
       return ce
       
      Parameters:
      value - set to true to enable setting the height
      Returns:
      the current instance of ConfiguratorTableInputBuilder
    • withPreferenceName

      public ConfiguratorTableInputBuilder withPreferenceName(String preferenceName)
      Defines the preference name (whitespace and non-alphanumeric will be dropped).

      Example:

      
       def contextParameter = api.inputBuilderFactory()
              .createConfiguratorTable('table')
              .withPreferenceName('someName')
              .buildContextParameter()
      
       contextParameter.getPreferenceName == 'someName'
       
      Parameters:
      preferenceName - name of the preference, cannot be whitespace or non-alphanumeric.
      Returns:
      the current instance of ConfiguratorTableInputBuilder
      Since:
      13.0 - Rampur
      See Also: