Hiding form elements
Forms elements can be automatically hidden depending on the screen size.
Example using HIDDEN@screen-size
The following form definition file uses the
HIDDEN
attribute with screen-size
specifiers, to indicated what elements must disappear, depending on the screen or container window
size. Note that field11
gets a STRETCH=X
attribute, to occupy all the space when the second grid is
hidden.LAYOUT (STYLE="main2")
HBOX
GRID grid1
{
[l11 |f11 ]
[l12 |f12 ]
}
END
GRID grid2 (HIDDEN@SMALL,HIDDEN@MEDIUM)
{
[l21 |f21 ]
[l22 |f22 ]
}
END
END
END
ATTRIBUTES
LABEL l11: label11, TEXT="Field11";
EDIT f11 = FORMONLY.field11, STRETCH=X;
LABEL l12: label12, TEXT="Field12", HIDDEN@SMALL;
DATEEDIT f12 = FORMONLY.field12, HIDDEN@SMALL;
LABEL l21: label21, TEXT="Field21";
EDIT f21 = FORMONLY.field21;
LABEL l22: label22, TEXT="Field22";
DATEEDIT f22 = FORMONLY.field22;
END
Rendering on a small screen: The grid2 and label12+field12 elements are hidden:
Rendering on a medium screen: The grid2 element is hidden:
Rendering on a large screen: All elements are visible: