Search in sources :

Example 1 with StudioProperty

use of io.jmix.ui.meta.StudioProperty in project jmix by jmix-framework.

the class DynamicAttributesPanel method setInstanceContainer.

/**
 * Defines InstanceContainer for DynamicAttributesPanel.
 *
 * @param container {@link InstanceContainer} object with editing entity
 */
@StudioProperty(name = "dataContainer", type = PropertyType.DATACONTAINER_REF, required = true)
public void setInstanceContainer(InstanceContainer<Object> container) {
    this.instanceContainer = container;
    propertiesForm.setValueSourceProvider(new ContainerValueSourceProvider<>(instanceContainer));
    initCategoryField(instanceContainer);
    initPropertiesForm();
    instanceContainer.addItemChangeListener(this::onInstanceContainerItemChangeEvent);
    if (instanceContainer instanceof HasLoader) {
        DataLoader loader = ((HasLoader) instanceContainer).getLoader();
        if (loader != null) {
            loader.setHint(DynAttrQueryHints.LOAD_DYN_ATTR, true);
        }
    }
}
Also used : DataLoader(io.jmix.ui.model.DataLoader) HasLoader(io.jmix.ui.model.HasLoader) StudioProperty(io.jmix.ui.meta.StudioProperty)

Aggregations

StudioProperty (io.jmix.ui.meta.StudioProperty)1 DataLoader (io.jmix.ui.model.DataLoader)1 HasLoader (io.jmix.ui.model.HasLoader)1