public class FormComponentUpdatingBehavior extends Behavior implements IRequestListener
FormComponent changes its value.
Contrary to AjaxFormComponentUpdatingBehavior all notification are sent via
standard HTTP requests and the full page is rendered as a response.
Notification is triggered by an event suitable for the host component this
behavior is added to - if needed getEvent() can be overridden to change the default
( for DropDownChoice, ListMultipleChoice and AbstractTextComponent,
for anything else).
Note: This behavior has limited support for FormComponents outside of a form, i.e. multiple
choice components (ListMultipleChoice and RadioGroup) will send their last selected
choice only.
onUpdate(),
Serialized Form| Constructor and Description |
|---|
FormComponentUpdatingBehavior() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(Component component)
Bind this handler to the given component.
|
protected String |
getEvent()
Which JavaScript event triggers notification.
|
FormComponent<?> |
getFormComponent()
Get the hosting component.
|
boolean |
getStatelessHint(Component component)
This method returns false if the behavior generates a callback url (for example ajax
behaviors)
|
protected boolean |
getUpdateModel()
Gives the control to the application to decide whether the form component model should
be updated automatically or not.
|
protected void |
onBind()
Called when the component was bound to it's host component.
|
void |
onComponentTag(Component component,
ComponentTag tag)
Called any time a component that has this behavior registered is rendering the component tag.
|
protected void |
onError(RuntimeException e)
Hook method invoked when updating of the component resulted in an error.
|
void |
onRequest()
Called when a request is received.
|
protected void |
onUpdate()
Hook method invoked when the component is updated.
|
afterRender, beforeRender, canCallListener, detach, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag, renderHead, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrendersPagepublic boolean getStatelessHint(Component component)
BehaviorgetStatelessHint in class Behaviorcomponent - the component that has this behavior coupled.public final void bind(Component component)
Behaviorprotected void onBind()
getFormComponent().public final FormComponent<?> getFormComponent()
public void onComponentTag(Component component, ComponentTag tag)
BehavioronComponentTag in class Behaviorcomponent - the component that renders this tag currentlytag - the tag that is renderedprotected String getEvent()
protected boolean getUpdateModel()
FormComponent.valid()
additionally in case the application want to update the model manually.protected void onUpdate()
Note: #onError(AjaxRequestTarget, RuntimeException) is called instead when processing
of the FormComponent failed with conversion or validation errors!
protected void onError(RuntimeException e)
The RuntimeException will be null if it was just a validation or conversion error of the
FormComponent.
e - optional runtime exceptionpublic final void onRequest()
IRequestListeneronRequest in interface IRequestListenerCopyright © 2006–2018 Apache Software Foundation. All rights reserved.