public abstract class Hidden extends AbstractFormComponent
{
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
IForm form = getForm(cycle);
boolean formRewound = form.isRewinding();
String name = form.getElementId(this);
// If the form containing the Hidden isn't rewound, then render.
if (!formRewound)
{
// Optimiziation: if the page is rewinding (some other action or
// form was submitted), then don't bother rendering.
if (cycle.isRewinding())
return;
String externalValue = null;
if (getEncode())
{
Object value = getValue();
try
{
externalValue = getDataSqueezer().squeeze(value);
}
catch (IOException ex)
{
throw new ApplicationRuntimeException(ex.getMessage(), this, null, ex);
}
}
else
externalValue = (String) getBinding("value").getObject(String.class);
String id = getElementId();
form.addHiddenValue(name, id, externalValue);
return;
}
String externalValue = cycle.getParameter(name);