addValidator();
}
private void addPropertiesAndOrCollections() {
final EntityModel entityModel = (EntityModel) getModel();
final ObjectAdapter adapter = entityModel.getObject();
final ObjectSpecification noSpec = adapter.getSpecification();
final List<ObjectAssociation> associations = visibleAssociations(adapter, noSpec);
final RepeatingView rv = new RepeatingView(ID_PROPERTIES_AND_OR_COLLECTIONS);
final EvenOrOddCssClassAppenderFactory eo = new EvenOrOddCssClassAppenderFactory();
add(rv);
@SuppressWarnings("unused")
Component component;
for (final ObjectAssociation association : associations) {
final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
rv.add(container);
container.add(eo.nextClass());
if (association instanceof OneToOneAssociation) {
final OneToOneAssociation otoa = (OneToOneAssociation) association;
final PropertyMemento pm = new PropertyMemento(otoa);
final ScalarModel scalarModel = entityModel.getPropertyModel(pm);
component = getComponentFactoryRegistry().addOrReplaceComponent(container, ID_PROPERTY_OR_COLLECTION, ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
} else {
final OneToManyAssociation otma = (OneToManyAssociation) association;
final EntityCollectionModel entityCollectionModel = EntityCollectionModel.createParented(entityModel, otma);