Class DynamicAttributesPanel

java.lang.Object
io.jmix.ui.component.CompositeComponent<VBoxLayout>
io.jmix.dynattrui.panel.DynamicAttributesPanel
All Implemented Interfaces:
AttachNotifier, Component, Component.BelongToFrame, HasDebugId, HasHtmlSanitizer, HasMargin, Validatable

@StudioComponent(category="Components", unsupportedProperties={"enable","responsive"}, xmlns="http://jmix.io/schema/dynattr/ui", xmlnsAlias="dynattr", icon="io/jmix/dynattrui/icon/component/dynamicAttributesPanel.svg", canvasIcon="io/jmix/dynattrui/icon/component/dynamicAttributesPanel_canvas.svg", canvasIconSize=LARGE) public class DynamicAttributesPanel extends CompositeComponent<VBoxLayout> implements Validatable, HasMargin
  • Field Details

  • Constructor Details

    • DynamicAttributesPanel

      public DynamicAttributesPanel()
  • Method Details

    • onCreate

      protected void onCreate(CompositeComponent.CreateEvent createEvent)
    • initPropertiesForm

      protected void initPropertiesForm()
    • addFieldsToForm

      protected void addFieldsToForm(Form newPropertiesForm, Map<AttributeDefinition,Component> fields)
    • getRowsPerColumn

      protected int getRowsPerColumn(int propertiesCount)
    • getAttributesByCategory

      protected Collection<AttributeDefinition> getAttributesByCategory()
    • generateFieldComponent

      protected Component generateFieldComponent(AttributeDefinition attribute)
    • setWidth

      protected void setWidth(Component component, AttributeDefinition attribute)
    • initCategoryField

      protected void initCategoryField(InstanceContainer<?> instanceContainer)
    • getDefaultCategory

      @Nullable protected Category getDefaultCategory()
    • getCategoryDefinitions

      protected Collection<CategoryDefinition> getCategoryDefinitions()
    • getCategoriesOptionsList

      protected List<Category> getCategoriesOptionsList()
    • initFieldCaptionWidth

      protected void initFieldCaptionWidth(Form newRuntimeForm)
    • onInstanceContainerItemChangeEvent

      protected void onInstanceContainerItemChangeEvent(InstanceContainer.ItemChangeEvent<?> event)
    • setInstanceContainer

      @StudioProperty(name="dataContainer", type=DATACONTAINER_REF, required=true) public void setInstanceContainer(InstanceContainer<Object> container)
      Defines InstanceContainer for DynamicAttributesPanel.
      Parameters:
      container - InstanceContainer object with editing entity
    • setColumnsCount

      @StudioProperty(name="cols") @Positive public void setColumnsCount(Integer cols)
      Sets the number of columns. If null value is passed, columns count will be determined based on the rows parameter.
      Parameters:
      cols - positive integer or null
    • setRowsCount

      @StudioProperty(name="rows") @Positive public void setRowsCount(Integer rows)
      Sets the number of rows. This parameter will only be taken into account if cols == null.
      Parameters:
      rows - positive integer or null
    • setFieldWidth

      @StudioProperty(type=SIZE) public void setFieldWidth(String fieldWidth)
      Sets the width of the fields. This parameter is used if some dynamic attribute does not have own width value.
      Parameters:
      fieldWidth - width of the fields
    • setFieldCaptionWidth

      @StudioProperty(type=SIZE) public void setFieldCaptionWidth(String fieldCaptionWidth)
      Sets the width of the fields caption. fieldCaptionWidth with '%' unit is unsupported.
      Parameters:
      fieldCaptionWidth - width of the fields caption
    • setCategoryFieldVisible

      public void setCategoryFieldVisible(boolean visible)
      Sets visibility of the CategoryField component.
      Parameters:
      visible - visibility flag
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface Validatable
    • validate

      public void validate() throws ValidationException
      Specified by:
      validate in interface Validatable
      Throws:
      ValidationException
    • setMargin

      public void setMargin(MarginInfo marginInfo)
      Specified by:
      setMargin in interface HasMargin
    • getMargin

      public MarginInfo getMargin()
      Specified by:
      getMargin in interface HasMargin