}
};
}
});
final AjaxDropDownChoicePanel intAttrNames = new AjaxDropDownChoicePanel<String>("intAttrNames",
getString("intAttrNames"), new PropertyModel(mappingTO, "intAttrName"));
intAttrNames.setChoices(schemaNames);
intAttrNames.setRequired(true);
intAttrNames.setStyleShet(fieldStyle);
item.add(intAttrNames);
final AjaxDropDownChoicePanel typesPanel = new AjaxDropDownChoicePanel("intMappingTypes",
new ResourceModel("intMappingTypes", "intMappingTypes").getObject(),
new PropertyModel<IntMappingType>(mappingTO, "intMappingType"));
// typesPanel onChange behavior provided below ...
typesPanel.setRequired(true);
typesPanel.setChoices(attrTypes);
typesPanel.setStyleShet(fieldStyle);
item.add(typesPanel);
final AjaxDropDownChoicePanel mappingTypesPanel = new AjaxDropDownChoicePanel("mappingTypes",
new ResourceModel("mappingTypes", "mappingTypes").getObject(), new Model(entity));
mappingTypesPanel.setChoices(Arrays.asList(AttributableType.values()));
mappingTypesPanel.setStyleShet(defFieldStyle);
item.add(mappingTypesPanel);
mappingTypesPanel.getField().add(new AjaxFormComponentUpdatingBehavior(onchange) {
private static final long serialVersionUID = -1107858522700306810L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
attrTypes = getAttributeTypes((AttributableType) mappingTypesPanel.getModelObject());
typesPanel.setChoices(attrTypes);
intAttrNames.setChoices(Collections.EMPTY_LIST);
target.add(typesPanel.getField());