Class ImageButton
- All Implemented Interfaces:
Serializable
,Iterable<Component>
,IEventSink
,IEventSource
,IFeedbackContributor
,IConverterLocator
,IGenericComponent<String,
,FormComponent<String>> IMetadataContext<Serializable,
,Component> IRequestListener
,IFormModelUpdateListener
,IFormSubmitter
,IFormSubmittingComponent
,IFormVisitorParticipant
,ILabelProvider<String>
,IHeaderContributor
,IRequestableComponent
,IHierarchical<Component>
,IClusterable
<input type="image"> component - like
Button
only with an image.
For details of how ImageButtons load, generate and manage images, see
LocalizedImageResource
.
- Author:
- Jonathan Locke
- See Also:
-
Field Summary
Fields inherited from class org.apache.wicket.markup.html.form.FormComponent
FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL, VALUE_SEPARATOR
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
ConstructorDescriptionImageButton
(String id, String string) ImageButton
(String id, IModel<String> model) ImageButton
(String id, IResource imageResource) Constructs an image directly from an image resource.ImageButton
(String id, ResourceReference resourceReference) Constructs an image button from an imageResourceReference
.ImageButton
(String id, ResourceReference resourceReference, PageParameters resourceParameters) Constructs an image button from an imageResourceReference
. -
Method Summary
Modifier and TypeMethodDescriptionprotected IResource
protected ResourceReference
protected boolean
Returns whether the component can be stateless.protected final void
Processes the component tag.void
Called when a request is received.boolean
Does invocation of this listener render the page.setDefaultModel
(IModel<?> model) Sets the given model.void
setImageResource
(IResource imageResource) void
setImageResourceReference
(ResourceReference resourceReference) void
setImageResourceReference
(ResourceReference resourceReference, PageParameters parameters) Methods inherited from class org.apache.wicket.markup.html.form.Button
getDefaultFormProcessing, getForm, getOnClickScript, initModel, onAfterSubmit, onComponentTagBody, onError, onSubmit, renderHead, setDefaultFormProcessing, updateModel
Methods inherited from class org.apache.wicket.markup.html.form.FormComponent
add, add, checkRequired, clearInput, convertInput, convertValue, error, getConvertedInput, getDefaultLabel, getDefaultLabel, getInput, getInputAsArray, getInputName, getModelValue, getParameterValues, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isMultiPart, isRequired, isValid, newValidatable, newValidationError, onDetach, onDisabled, onInvalid, onValid, processChildren, processInput, remove, reportRequiredError, setConvertedInput, setLabel, setModelValue, setRequired, setType, shouldTrimInput, trim, updateAutoLabels, updateCollectionModel, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrder
Methods inherited from class org.apache.wicket.markup.html.form.LabeledWebMarkupContainer
getLabel
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, renderNext, replace, 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, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, 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.markup.html.form.IFormSubmittingComponent
getInputName
Methods inherited from interface org.apache.wicket.IGenericComponent
getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModelObject, setModel, setModelObject
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ImageButton
Constructs an image button from an imageResourceReference
. That resource reference will bind its resource to the current SharedResources. If you are using non sticky session clustering and the resource reference is pointing to aResource
that isn't guaranteed to be on every server, for example a dynamic image or resources that aren't added with aIInitializer
at application startup. Then if only that resource is requested from another server, without the rendering of the page, the image won't be there and will result in a broken link.- Parameters:
id
- See ComponentresourceReference
- The shared image resource
-
ImageButton
public ImageButton(String id, ResourceReference resourceReference, PageParameters resourceParameters) Constructs an image button from an imageResourceReference
. That resource reference will bind its resource to the current SharedResources. If you are using non sticky session clustering and the resource reference is pointing to aResource
that isn't guaranteed to be on every server, for example a dynamic image or resources that aren't added with aIInitializer
at application startup. Then if only that resource is requested from another server, without the rendering of the page, the image won't be there and will result in a broken link.- Parameters:
id
- See ComponentresourceReference
- The shared image resourceresourceParameters
- The resource parameters
-
ImageButton
Constructs an image directly from an image resource. This one doesn't have the 'non sticky session clustering' problem that theResourceReference
constructor has. But this will result in a non 'stable' url and the url will have request parameters.- Parameters:
id
- See ComponentimageResource
- The image resource
-
ImageButton
- Parameters:
id
-model
-- See Also:
-
ImageButton
- Parameters:
id
- See Componentstring
- Name of image- See Also:
-
-
Method Details
-
rendersPage
Description copied from interface:IRequestListener
Does invocation of this listener render the page.- Specified by:
rendersPage
in interfaceIRequestListener
- Returns:
- default
true
, i.e. aRenderPageRequestHandler
is schedules after invocation
-
onRequest
Description copied from interface:IRequestListener
Called when a request is received.- Specified by:
onRequest
in interfaceIRequestListener
-
setImageResource
- Parameters:
imageResource
- The new ImageResource to set.
-
setImageResourceReference
- Parameters:
resourceReference
- The shared ImageResource to set.
-
setImageResourceReference
public void setImageResourceReference(ResourceReference resourceReference, PageParameters parameters) - Parameters:
resourceReference
- The shared ImageResource to set.parameters
- Set the resource parameters for the resource.
-
setDefaultModel
Description copied from class:Component
Sets the given model.WARNING: DO NOT OVERRIDE THIS METHOD UNLESS YOU HAVE A VERY GOOD REASON FOR IT. OVERRIDING THIS MIGHT OPEN UP SECURITY LEAKS AND BREAK BACK-BUTTON SUPPORT.
- Specified by:
setDefaultModel
in interfaceIGenericComponent<String,
FormComponent<String>> - Overrides:
setDefaultModel
in classMarkupContainer
- Parameters:
model
- The model- Returns:
- This
- See Also:
-
getImageResource
- Returns:
- Resource returned from subclass
-
getImageResourceReference
- Returns:
- ResourceReference returned from subclass
-
onComponentTag
Processes the component tag.- Overrides:
onComponentTag
in classButton
- Parameters:
tag
- Tag to modify- See Also:
-
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 classComponent
- Returns:
- whether the component can be stateless
- See Also:
-