* Renders a <div> tag and provides an override of the {@link org.apache.tapestry5.services.FormSupport}
* environmental.
*/
void beginRender(MarkupWriter writer)
{
FormSupport formSupport = environment.peekRequired(FormSupport.class);
clientId = resources.isBound("id") ? idParameter : javascriptSupport.allocateClientId(resources);
hiddenFieldPositioner = new HiddenFieldPositioner(writer, rules);
Element element = writer.element(this.element, "id", clientId);
resources.renderInformalParameters(writer);
if (!visible)
element.addClassName(CSSClassConstants.INVISIBLE);
clientBehaviorSupport.addFormFragment(clientId, alwaysSubmit, show, hide);
componentActions = new ComponentActionSink(logger, clientDataEncoder);
// Here's the magic of environmentals ... we can create a wrapper around
// the normal FormSupport environmental that intercepts some of the behavior.
// Here we're setting aside all the actions inside the FormFragment so that we
// can control whether those actions occur when the form is submitted.
FormSupport override = new FormSupportAdapter(formSupport)
{
@Override
public <T> void store(T component, ComponentAction<T> action)
{
componentActions.store(component, action);