if (invalidHeight) {
Stack<ComponentInfo> attributes = null;
String msg = "";
// set proper error messages
if (parent instanceof AbstractOrderedLayout) {
AbstractOrderedLayout ol = (AbstractOrderedLayout) parent;
boolean vertical = false;
if (ol instanceof OrderedLayout) {
if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) {
vertical = true;
}
} else if (ol instanceof VerticalLayout) {
vertical = true;
}
if (vertical) {
msg = "Component with relative height inside a VerticalLayout with no height defined.";
attributes = getHeightAttributes(component);
} else {
msg = "At least one of a HorizontalLayout's components must have non relative height if the height of the layout is not defined";
attributes = getHeightAttributes(component);
}
} else if (parent instanceof GridLayout) {
msg = "At least one of the GridLayout's components in each row should have non relative height if the height of the layout is not defined.";
attributes = getHeightAttributes(component);
} else {
// default error for non sized parent issue
msg = "A component with relative height needs a parent with defined height.";
attributes = getHeightAttributes(component);
}
printServerError(msg, attributes, false, serverErrorStream);
clientJSON.print(",\"heightMsg\":\""
+ JsonPaintTarget.escapeJSON(msg) + "\"");
}
if (invalidWidth) {
Stack<ComponentInfo> attributes = null;
String msg = "";
if (parent instanceof AbstractOrderedLayout) {
AbstractOrderedLayout ol = (AbstractOrderedLayout) parent;
boolean horizontal = true;
if (ol instanceof OrderedLayout) {
if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) {
horizontal = false;