* Renders a <div> tag and provides an override of the {@link org.apache.tapestry.services.FormSupport}
* environmental.
*/
void beginRender(MarkupWriter writer)
{
FormSupport formSupport = _environment.peekRequired(FormSupport.class);
String id = _resources.getId();
_controlName = formSupport.allocateControlName(id);
_clientId = _pageRenderSupport.allocateClientId(id);
Element element = writer.element("div", "id", _clientId);
_resources.renderInformalParameters(writer);
if (!_visible)
element.addClassName(TapestryConstants.INVISIBLE_CLASS);
writer.element("input",
"type", "hidden",
"name", _controlName,
"id", _clientId + ":hidden",
"value", String.valueOf(_visible));
writer.end();
_clientBehaviorSupport.addFormFragment(_clientId, _show, _hide);
_componentActions = CollectionFactory.newList();
// 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)
{
Component asComponent = Defense.cast(component, Component.class, "component");