Class StatelessForm<T>
- java.lang.Object
-
- org.apache.wicket.Component
-
- org.apache.wicket.MarkupContainer
-
- org.apache.wicket.markup.html.WebMarkupContainer
-
- org.apache.wicket.markup.html.form.Form<T>
-
- org.apache.wicket.markup.html.form.StatelessForm<T>
-
- Type Parameters:
T
- The type of theForm
's model object
- All Implemented Interfaces:
Serializable
,Iterable<Component>
,IEventSink
,IEventSource
,IFeedbackContributor
,IConverterLocator
,IGenericComponent<T,Form<T>>
,IMetadataContext<Serializable,Component>
,IRequestListener
,IHeaderContributor
,IRequestableComponent
,IHierarchical<Component>
,IClusterable
- Direct Known Subclasses:
SignInPanel.SignInForm
public class StatelessForm<T> extends Form<T>
This StatelessForm is the same as a normal form but with the statelesshint default to true. The form can be newly constructed when the onSubmit of its form or its buttons is called. So you can't depend on state within the page. The only state you can depend on is what was submitted from the browser. So the model of the form or the formcomponents are updated with the submit values. Note: UseRepeatingView
in the case whenFormComponent
s need to be rendered inside a repeater. See the javadoc ofAbstractRepeater
for more information.- Author:
- jcompagner
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.markup.html.form.Form
Form.MethodMismatchResponse, Form.ValidationVisitor
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.markup.html.form.Form
ENCTYPE_MULTIPART_FORM_DATA, HIDDEN_FIELDS_CSS_CLASS_KEY, METHOD_GET, METHOD_POST, UPLOAD_FAILED_RESOURCE_KEY, UPLOAD_SINGLE_FILE_TOO_LARGE_RESOURCE_KEY, UPLOAD_TOO_LARGE_RESOURCE_KEY, UPLOAD_TOO_MANY_FILES_RESOURCE_KEY
-
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS
-
-
Constructor Summary
Constructors Constructor Description StatelessForm(String id)
Construct.StatelessForm(String id, IModel<T> model)
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CharSequence
getActionUrl()
Generates the action url for the formprotected boolean
getStatelessHint()
Returns whether the component can be stateless.protected Form.MethodMismatchResponse
onMethodMismatch()
Called when a form has been submitted using a method differing from return value ofForm.getMethod()
.void
process(IFormSubmitter submittingComponent)
Remove the page parameters for all form component otherwise they get appended to action URL Process the form.-
Methods inherited from class org.apache.wicket.markup.html.form.Form
add, addDefaultSubmitButtonHandler, appendDefaultButtonField, beforeUpdateFormComponentModels, callOnError, clearInput, delegateSubmit, encodeUrlInHiddenFields, error, findForm, findSubmitter, getDefaultButton, getFileCountMax, getFileMaxSize, getFormValidators, getInputNamePrefix, getJsForListenerUrl, getJsForSubmitter, getMaxSize, getMethod, getRootForm, getRootFormRelativeId, getValidatorKeyPrefix, handleMultiPart, hasError, internalOnModelChanged, isMultiPart, isRootForm, isSubmitted, markFormComponentsInvalid, markFormComponentsValid, onBeforeRender, onComponentTag, onComponentTagBody, onDetach, onError, onEvent, onFileUploadException, onFormSubmitted, onRequest, onSubmit, onValidate, onValidateModelObjects, remove, renderHead, renderPlaceholderTag, setDefaultButton, setFileCountMax, setFileMaxSize, setMaxSize, setMultiPart, setVersioned, updateFormComponentModels, validate, validateComponents, validateFormValidator, validateFormValidators, visitFormComponents, visitFormComponentsPostOrder, wantSubmitOnNestedFormSubmit, wantSubmitOnParentFormSubmit, writeHiddenFields, writeParamsAsHiddenFields
-
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
-
Methods inherited from class org.apache.wicket.MarkupContainer
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
-
Methods inherited from class org.apache.wicket.Component
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onConfigure, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderPart, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.IGenericComponent
getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObject
-
Methods inherited from interface org.apache.wicket.IRequestListener
rendersPage
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
StatelessForm
public StatelessForm(String id)
Construct.- Parameters:
id
-
-
StatelessForm
public StatelessForm(String id, IModel<T> model)
Construct.- Parameters:
id
-model
-
-
-
Method Detail
-
getStatelessHint
protected boolean getStatelessHint()
Description copied from class:Component
Returns whether the component can be stateless. Also the component behaviors must be stateless, otherwise the component will be treat as stateful. In order for page to be stateless (and not to be stored in session), all components (and component behaviors) must be stateless.- Overrides:
getStatelessHint
in classForm<T>
- Returns:
- whether the component can be stateless
- See Also:
Component.getStatelessHint()
-
onMethodMismatch
protected Form.MethodMismatchResponse onMethodMismatch()
Description copied from class:Form
Called when a form has been submitted using a method differing from return value ofForm.getMethod()
. For example, someone can copy and paste the action url and invoke the form using aGET
instead of the desiredPOST
. This method allows the user to react to this situation.- Overrides:
onMethodMismatch
in classForm<T>
- Returns:
- response that can either abort or continue the processing of the form
-
getActionUrl
protected CharSequence getActionUrl()
Description copied from class:Form
Generates the action url for the form- Overrides:
getActionUrl
in classForm<T>
- Returns:
- action url
-
process
public void process(IFormSubmitter submittingComponent)
Remove the page parameters for all form component otherwise they get appended to action URL Process the form. Though you can override this method to provide your own algorithm, it is not recommended to do so.See the class documentation for further details on the form processing
- Overrides:
process
in classForm<T>
- Parameters:
submittingComponent
- component responsible for submitting the form, ornull
if none (eg the form has been submitted via the enter key or javascript calling form.submit())- See Also:
for an easy way to process submitting component in the default manner
-
-