Search in sources :

Example 1 with MapPropertyType

use of org.jboss.errai.databinding.client.MapPropertyType in project kie-wb-common by kiegroup.

the class MapModelBindingHelperTest method checkBindableProxy.

protected void checkBindableProxy(MapBindableProxy model) {
    assertFalse(model.getBeanProperties().isEmpty());
    checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_NAME), String.class);
    checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_SURNAME), String.class);
    checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_AGE_BINDING), Integer.class);
    checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_BIRTHDAY), Date.class);
    checkSimpleTypeProperty(model.getBeanProperties().get(EMPLOYEE_MARRIED), Boolean.class);
    PropertyType addressPropertyType = model.getBeanProperties().get(EMPLOYEE_ADDRESS);
    assertNotNull(addressPropertyType);
    assertTrue(addressPropertyType instanceof MapPropertyType);
    MapPropertyType address = (MapPropertyType) addressPropertyType;
    checkSimpleTypeProperty(address.getPropertyTypes().get(ADDRESS_STREET), String.class);
    checkSimpleTypeProperty(address.getPropertyTypes().get(ADDRESS_NUM), Integer.class);
}
Also used : MapPropertyType(org.jboss.errai.databinding.client.MapPropertyType) MapPropertyType(org.jboss.errai.databinding.client.MapPropertyType) PropertyType(org.jboss.errai.databinding.client.PropertyType)

Example 2 with MapPropertyType

use of org.jboss.errai.databinding.client.MapPropertyType in project kie-wb-common by kiegroup.

the class MapModelBindingHelper method getModeldefinitionFor.

public MapPropertyType getModeldefinitionFor(MultipleSubFormFieldDefinition subFormField, MapModelRenderingContext context, Map<String, Map<String, PropertyType>> availableModels) {
    FormDefinition creationForms = context.getAvailableForms().get(subFormField.getCreationForm());
    Map<String, PropertyType> modelDefinition = generateModelDefinition(creationForms, context, availableModels);
    FormDefinition editionForm = context.getAvailableForms().get(subFormField.getCreationForm());
    modelDefinition.putAll(generateModelDefinition(editionForm, context, availableModels));
    modelDefinition.put(MapModelRenderingContext.FORM_ENGINE_OBJECT_IDX, new PropertyType(Integer.class));
    modelDefinition.put(MapModelRenderingContext.FORM_ENGINE_EDITED_OBJECT, new PropertyType(Boolean.class));
    return new MapPropertyType(modelDefinition);
}
Also used : BigInteger(java.math.BigInteger) MapPropertyType(org.jboss.errai.databinding.client.MapPropertyType) MapPropertyType(org.jboss.errai.databinding.client.MapPropertyType) PropertyType(org.jboss.errai.databinding.client.PropertyType) FormDefinition(org.kie.workbench.common.forms.model.FormDefinition)

Aggregations

MapPropertyType (org.jboss.errai.databinding.client.MapPropertyType)2 PropertyType (org.jboss.errai.databinding.client.PropertyType)2 BigInteger (java.math.BigInteger)1 FormDefinition (org.kie.workbench.common.forms.model.FormDefinition)1