public abstract IForm getForm();
public abstract void setForm(IForm form);
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
IForm form = Form.get(getPage().getRequestCycle());
if (form == null)
throw new ApplicationRuntimeException(
"Palette component must be wrapped by a Form.",
this,
null,
null);
setForm(form);
IValidationDelegate delegate = form.getDelegate();
if (delegate != null)
delegate.setFormComponent(this);
setName(form.getElementId(this));
if (form.isRewinding())
handleSubmission(cycle);
// Don't do any additional work if rewinding
// (some other action or form on the page).
if (!cycle.isRewinding())
{
// Lots of work to produce JavaScript and HTML for this sucker.
_symbols = new HashMap(MAP_SIZE);
runScript(cycle);
// Output symbol 'formSubmitFunctionName' is the name
// of a JavaScript function to execute when the form
// is submitted. This is also key to the operation
// of the PropertySelection.
form.addEventHandler(
FormEventType.SUBMIT,
(String) _symbols.get("formSubmitFunctionName"));
constructColumns();
}