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);
}
}
}
Aggregations