*/
public EntityLookupTablePanel(final ModelContext modelContext,
final ViewContext viewContext) {
super(viewContext.getWicketId());
try {
App app = viewContext.getApp();
IEntities lookupEntities = modelContext.getLookupEntities();
ConceptConfig lookupConceptConfig = lookupEntities
.getConceptConfig();
String conceptsKey = lookupConceptConfig.getEntitiesCode();
String conceptsName = getLocalizer().getString(conceptsKey, this);
add(new Label("conceptsName", conceptsName));
List<String> conceptEssentialPropertyNames = new ArrayList<String>();
List<String> conceptEssentiaPropertyCodes = lookupEntities
.getConceptConfig().getConceptCodeEssentialPropertyCodes();
String conceptPropertyName;
for (String conceptPropertyKey : conceptEssentiaPropertyCodes) {
conceptPropertyName = getLocalizer().getString(
conceptPropertyKey, this);
conceptEssentialPropertyNames.add(conceptPropertyName);
}
List<String> parentEssentialPropertyNames = new ArrayList<String>();
List<String> parentEssentialPropertyCodes = lookupEntities
.getConceptConfig().getParentCodeEssentialPropertyCodes();
String parentPropertyName;
for (String parentPropertyKey : parentEssentialPropertyCodes) {
parentPropertyName = getLocalizer().getString(
parentPropertyKey, this);
parentEssentialPropertyNames.add(parentPropertyName);
}
List<String> essentialPropertyNames = conceptEssentialPropertyNames;
if (parentEssentialPropertyNames.size() > 0) {
essentialPropertyNames.addAll(parentEssentialPropertyNames);
}
add(new PropertyNameLabelListView("propertyNameLabelListView",
essentialPropertyNames));
List<String> childNeighborNames = lookupConceptConfig
.getChildNeighborNames();
add(new NeighborEmptyNameLabelListView(
"neighborEmptyNameLabelListViewHead", childNeighborNames));
ModelContext lookupModelContext = new ModelContext(modelContext);
lookupModelContext.setContextEntities(lookupModelContext
.getEntities());
lookupModelContext.setEntities(lookupEntities);
ViewContext lookupViewContext = new ViewContext(viewContext);
lookupViewContext.setWicketId("entityLookupTableListView");
PageableListView entityLookupTableListView = app.getViewMeta()
.getPageableListView("EntityLookupTableListView",
lookupModelContext, lookupViewContext);
add(entityLookupTableListView);
if (!app.isConceptDisplayAllowed(getAppSession(),
lookupConceptConfig)) {
entityLookupTableListView.setVisible(false);
}
add(new PropertyEmptyNameLabelListView(