Search in sources :

Example 1 with IDataLinkedType

use of com.servoy.j2db.server.ngclient.property.types.IDataLinkedType in project servoy-client by Servoy.

the class ComponentPropertyType method findRecordAwareRootProperties.

protected RecordBasedProperties findRecordAwareRootProperties(FormElement formElement, FlattenedSolution flattenedSolution) {
    RecordBasedProperties m = new RecordBasedProperties();
    // tagstrings, valuelists, tab seq, ... must be implemented separately and provided as a
    // viewport containing these values as part of 'components' property
    Set<Entry<String, PropertyDescription>> propertyDescriptors = formElement.getWebComponentSpec().getProperties().entrySet();
    for (Entry<String, PropertyDescription> propertyDescriptorEntry : propertyDescriptors) {
        PropertyDescription pd = propertyDescriptorEntry.getValue();
        IPropertyType<?> type = pd.getType();
        if (type instanceof IDataLinkedType) {
            // as these are root-level component properties, their TargetDataLinks will always be cached (only array element values are not cached)
            TargetDataLinks dataLinks = ((IDataLinkedType) type).getDataLinks(formElement.getPropertyValue(pd.getName()), propertyDescriptorEntry.getValue(), flattenedSolution, formElement);
            if (dataLinks != TargetDataLinks.NOT_LINKED_TO_DATA && dataLinks.recordLinked) {
                m.addRecordBasedProperty(propertyDescriptorEntry.getKey(), dataLinks.dataProviderIDs, null);
            }
        }
    }
    return m;
}
Also used : PropertyDescription(org.sablo.specification.PropertyDescription) Entry(java.util.Map.Entry) IDataLinkedType(com.servoy.j2db.server.ngclient.property.types.IDataLinkedType) TargetDataLinks(com.servoy.j2db.server.ngclient.property.types.IDataLinkedType.TargetDataLinks)

Aggregations

IDataLinkedType (com.servoy.j2db.server.ngclient.property.types.IDataLinkedType)1 TargetDataLinks (com.servoy.j2db.server.ngclient.property.types.IDataLinkedType.TargetDataLinks)1 Entry (java.util.Map.Entry)1 PropertyDescription (org.sablo.specification.PropertyDescription)1