final ColumnSpans columnSpans = entityModel.getObject().getSpecification().getFacet(MemberGroupLayoutFacet.class).getColumnSpans();
renderedFirstField = false;
// left column
MarkupContainer leftColumn = new WebMarkupContainer(ID_LEFT_COLUMN);
add(leftColumn);
boolean addedProperties;
if(columnSpans.getLeft() > 0) {
addedProperties = addPropertiesInColumn(leftColumn, MemberGroupLayoutHint.LEFT, columnSpans);
addButtons(leftColumn);
addFeedbackGui(leftColumn);
} else {
Components.permanentlyHide(this, ID_LEFT_COLUMN);
addedProperties = false;
}
if(!addedProperties) {
// a bit hacky...
Components.permanentlyHide(this,
ID_EDIT_BUTTON, ID_OK_BUTTON, ID_CANCEL_BUTTON,
ID_FEEDBACK);
}
// middle column
if(columnSpans.getMiddle() > 0) {
MarkupContainer middleColumn = new WebMarkupContainer(ID_MIDDLE_COLUMN);
add(middleColumn);
addPropertiesInColumn(middleColumn, MemberGroupLayoutHint.MIDDLE, columnSpans);
} else {
Components.permanentlyHide(this, ID_MIDDLE_COLUMN);
}
// right column
if(columnSpans.getRight() > 0) {
MarkupContainer rightColumn = new WebMarkupContainer(ID_RIGHT_COLUMN);
add(rightColumn);
addPropertiesInColumn(rightColumn, MemberGroupLayoutHint.RIGHT, columnSpans);
} else {
Components.permanentlyHide(this, ID_RIGHT_COLUMN);
}