|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.tacos.ajax.components.AjaxFormSupportImpl
public class AjaxFormSupportImpl
Encapsulates most of the behavior of a Form component.
Field Summary | |
---|---|
protected AjaxWebRequest |
ajaxRequest
|
static String |
FIELD_FOCUS_ATTRIBUTE
Attribute set to true when a field has been focused; used to prevent conflicting JavaScript for field focusing from being emitted. |
static String |
FORM_IDS
Name of query parameter storing the ids alloocated while rendering the form, as a comma seperated list. |
protected org.apache.tapestry.IMarkupWriter |
hiddenWriter
|
static String |
RESERVED_FORM_IDS
Names of additional ids that were pre-reserved, as a comma-sepereated list. |
protected ResponseBuilder |
response
|
static String |
SCRIPT
|
static String |
SUBMIT_MODE
Indicates why the form was submitted: whether for normal ("submit"), refresh, or because the form was canceled. |
Constructor Summary | |
---|---|
AjaxFormSupportImpl(org.apache.tapestry.IMarkupWriter writer,
org.apache.tapestry.IRequestCycle cycle,
AjaxWebRequest ajaxRequest,
org.apache.tapestry.IForm form)
Creates a new rendering support instance. |
Method Summary | |
---|---|
void |
addDeferredRunnable(Runnable runnable)
|
void |
addEventHandler(org.apache.tapestry.form.FormEventType type,
String functionName)
Adds an event handler for the form, of the given type. |
void |
addHiddenValue(String name,
String value)
|
void |
addHiddenValue(String name,
String id,
String value)
|
protected void |
emitEventHandlers(String formId)
|
protected void |
emitEventManagerInitialization(String formId)
Pre-renders the form, setting up some client-side form support. |
String |
getElementId(org.apache.tapestry.form.IFormComponent component)
Constructs a unique identifier (within the Form). |
String |
getElementId(org.apache.tapestry.form.IFormComponent component,
String baseId)
Constructs a unique identifier (within the Form). |
String |
getEncodingType()
If previously specified, the encoding type of this form |
protected org.apache.tapestry.IMarkupWriter |
getHiddenWriter()
Gets the correct IMarkupWriter for this
response render, depending on if this is a valid
ajax request and the form contains components
that were requested in render. |
boolean |
isRewinding()
|
void |
prerenderField(org.apache.tapestry.IMarkupWriter writer,
org.apache.tapestry.IComponent field,
Location location)
|
void |
registerForFocus(org.apache.tapestry.form.IFormComponent field,
int priority)
|
void |
render(String method,
org.apache.tapestry.IRender informalParametersRenderer,
org.apache.tapestry.engine.ILink link,
String scheme)
|
void |
render(String method,
org.apache.tapestry.IRender informalParametersRenderer,
org.apache.tapestry.engine.ILink link,
String scheme,
Integer port)
|
String |
rewind()
|
void |
setEncodingType(String encodingType)
|
protected boolean |
shouldRender()
Determines if script contributions should be rendered for the form. |
boolean |
wasPrerendered(org.apache.tapestry.IMarkupWriter writer,
org.apache.tapestry.IComponent field)
|
protected void |
writeHiddenField(org.apache.tapestry.IMarkupWriter writer,
String name,
String id,
String value)
Overwridden by org.apache.tapestry.wml.GoFormSupportImpl (WML). |
protected void |
writeHiddenFieldList()
Writes out all hidden values previously added by addHiddenValue(String, String, String) , plus the allocated id
list. |
protected void |
writeHiddenFields()
Writes out all hidden values previously added by addHiddenValue(String, String, String) . |
protected void |
writeTag(org.apache.tapestry.IMarkupWriter writer,
String method,
String url)
Writes the form action tag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FORM_IDS
public static final String RESERVED_FORM_IDS
public static final String SUBMIT_MODE
public static final String SCRIPT
public static final String FIELD_FOCUS_ATTRIBUTE
protected ResponseBuilder response
protected AjaxWebRequest ajaxRequest
protected org.apache.tapestry.IMarkupWriter hiddenWriter
Constructor Detail |
---|
public AjaxFormSupportImpl(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle, AjaxWebRequest ajaxRequest, org.apache.tapestry.IForm form)
writer
- cycle
- form
- Method Detail |
---|
public void addEventHandler(org.apache.tapestry.form.FormEventType type, String functionName)
addEventHandler
in interface org.apache.tapestry.FormBehavior
public void addHiddenValue(String name, String value)
addHiddenValue
in interface org.apache.tapestry.FormBehavior
public void addHiddenValue(String name, String id, String value)
addHiddenValue
in interface org.apache.tapestry.FormBehavior
protected void emitEventHandlers(String formId)
formId
- protected boolean shouldRender()
public String getElementId(org.apache.tapestry.form.IFormComponent component)
Simply invokes
getElementId(org.apache.tapestry.form.IFormComponent, java.lang.String)
with
the component's id.
getElementId
in interface org.apache.tapestry.FormBehavior
public String getElementId(org.apache.tapestry.form.IFormComponent component, String baseId)
Simply invokes
getElementId(org.apache.tapestry.form.IFormComponent, java.lang.String)
with
the component's id.
getElementId
in interface org.apache.tapestry.FormBehavior
public boolean isRewinding()
isRewinding
in interface org.apache.tapestry.FormBehavior
public void render(String method, org.apache.tapestry.IRender informalParametersRenderer, org.apache.tapestry.engine.ILink link, String scheme)
render
in interface org.apache.tapestry.form.FormSupport
public void render(String method, org.apache.tapestry.IRender informalParametersRenderer, org.apache.tapestry.engine.ILink link, String scheme, Integer port)
render
in interface org.apache.tapestry.form.FormSupport
protected void emitEventManagerInitialization(String formId)
public String rewind()
rewind
in interface org.apache.tapestry.form.FormSupport
public void setEncodingType(String encodingType)
setEncodingType
in interface org.apache.tapestry.FormBehavior
public String getEncodingType()
getEncodingType
in interface AjaxFormSupport
protected void writeHiddenField(org.apache.tapestry.IMarkupWriter writer, String name, String id, String value)
org.apache.tapestry.wml.GoFormSupportImpl
(WML).
protected org.apache.tapestry.IMarkupWriter getHiddenWriter()
IMarkupWriter
for this
response render, depending on if this is a valid
ajax request and the form contains components
that were requested in render.
protected void writeHiddenFields()
addHiddenValue(String, String, String)
. Writes a <div>
tag around writeHiddenFieldList()
. Overriden by
org.apache.tapestry.wml.GoFormSupportImpl
.
protected void writeHiddenFieldList()
addHiddenValue(String, String, String)
, plus the allocated id
list.
protected void writeTag(org.apache.tapestry.IMarkupWriter writer, String method, String url)
writer
- method
- url
- public void prerenderField(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IComponent field, Location location)
prerenderField
in interface org.apache.tapestry.FormBehavior
public boolean wasPrerendered(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IComponent field)
wasPrerendered
in interface org.apache.tapestry.FormBehavior
public void addDeferredRunnable(Runnable runnable)
addDeferredRunnable
in interface org.apache.tapestry.FormBehavior
public void registerForFocus(org.apache.tapestry.form.IFormComponent field, int priority)
registerForFocus
in interface org.apache.tapestry.FormBehavior
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |