Source Viewer : /form/contact-details.htm
This page demonstrates a Java centric approach to programmatically layout Fields inside a Form.
<p/>
In short the form fields are laid out using a combination of FieldSet and Html List tags; <ul> <li>.
<p/>
This demo consists of the following components: (Note, although some of these components
are quite generic, they are not part of Click and were created
specifically for this demo).
<ul>
<li style="padding:0.25em;">
<a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/control/html/cssform/CssForm.java" target="_blank">CssForm.java</a>
- adds the stylesheet <a href="$context/source-viewer.htm?filename=assets/css/cssform.css" target="_blank">cssform.css</a>
to the list of Html imports. This CSS is used to style the form and fields.
</li>
<li style="padding:0.25em;">
<a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/control/html/cssform/VerticalFieldSet.java" target="_blank">VerticalFieldSet.java</a>
- a custom FieldSet that renders its fields vertically using an HTML List: <ul>.
</li>
<li style="padding:0.25em;">
<a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/control/html/list/HtmlList.java" target="_blank">HtmlList.java</a>
and <a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/control/html/list/ListItem.java" target="_blank">ListItem.java</a>
- these components renders an HTML list, <ul>, and list item, <li>, respectively.
</li>
<li style="padding:0.25em;">
<a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/control/html/FeedbackBorder.java" target="_blank">FeedbackBorder.java</a>
- a component which decorates a Field with different borders, based on the Field's state.
</li>
<li style="padding:0.25em;">
<a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/control/html/FieldLabel.java" target="_blank">FieldLabel.java</a>
- provides a convenient class that generates an HTML Label for a Field.
</li>
</ul>
$form