ModelContext parentModelContext = new ModelContext(modelContext,
true);
parentModelContext.setEntity(parentEntity);
ViewContext parentViewContext = new ViewContext(viewContext, true);
parentViewContext.setWicketId("parentProperty");
PropertyConfig parentPropertyConfig = parentModelContext
.getPropertyConfig();
Panel parentPropertyPanel;
String propertyType = parentPropertyConfig.getPropertyClass();
if (propertyType.equals("java.net.URL")
|| propertyType.equals("org.dmlite.type.email.Email")) {
parentPropertyPanel = new ExternalLinkPanel(parentModelContext,
parentViewContext);
item.add(parentPropertyPanel);
} else if (parentPropertyConfig.getPropertyClass().equals(
"java.lang.String")
&& parentPropertyConfig.isValidateType()) {
if (parentPropertyConfig.getValidationType().equals(
"java.net.URL")
|| parentPropertyConfig.getValidationType().equals(
"org.dmlite.type.email.Email")) {
parentPropertyPanel = new ExternalLinkPanel(
parentModelContext, parentViewContext);
item.add(parentPropertyPanel);
} else {
parentPropertyPanel = new LabelPanel(parentModelContext,
parentViewContext);
item.add(parentPropertyPanel);
}
} else {
parentPropertyPanel = new LabelPanel(parentModelContext,
parentViewContext);
item.add(parentPropertyPanel);
}
if (!app.isPropertyDisplayAllowed(getAppSession(),
parentPropertyConfig)) {
parentPropertyPanel.setVisible(false);
}
ModelContext childModelContext = new ModelContext(modelContext,
true);
childModelContext.setEntity(parentEntity);
ViewContext childViewContext = new ViewContext(viewContext, true);
childViewContext.setWicketId("childPropertyList");
item.add(app.getViewMeta().getPanel(
"ChildPropertyDisplayListPanel", childModelContext,
childViewContext));
} catch (Exception e) {