public class ImageButton extends Button implements IResourceListener
Button
only with an image.
For details of how ImageButtons load, generate and manage images, see
LocalizedImageResource
.
FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL, VALUE_SEPARATOR
ENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING
INTERFACE
Constructor and Description |
---|
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 image
ResourceReference . |
ImageButton(String id,
ResourceReference resourceReference,
PageParameters resourceParameters)
Constructs an image button from an image
ResourceReference . |
ImageButton(String id,
String string) |
Modifier and Type | Method and Description |
---|---|
protected IResource |
getImageResource() |
protected ResourceReference |
getImageResourceReference() |
protected boolean |
getStatelessHint()
Returns whether the component can be stateless.
|
protected void |
onComponentTag(ComponentTag tag)
Processes the component tag.
|
void |
onResourceRequested()
Called when a resource is requested.
|
ImageButton |
setDefaultModel(IModel<?> model)
Sets the given model.
|
void |
setImageResource(IResource imageResource) |
void |
setImageResourceReference(ResourceReference resourceReference) |
void |
setImageResourceReference(ResourceReference resourceReference,
PageParameters parameters) |
getDefaultFormProcessing, getForm, getOnClickScript, initModel, onAfterSubmit, onComponentTagBody, onError, onSubmit, setDefaultFormProcessing, updateModel
add, add, checkRequired, clearInput, convertInput, convertValue, error, getConvertedInput, getDefaultLabel, getDefaultLabel, getInput, getInputAsArray, getInputName, getModel, getModelObject, getModelValue, getParameterValues, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isMultiPart, isRequired, isValid, newValidatable, newValidationError, onDetach, onDisabled, onInvalid, onRequired, onValid, processChildren, processInput, remove, reportRequiredError, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setRequired, setType, shouldTrimInput, trim, updateAutoLabels, updateCollectionModel, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrder
getLabel
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, 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, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInputName
public ImageButton(String id, ResourceReference resourceReference)
ResourceReference
. 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 a
Resource
that isn't guaranteed to be on every server, for example a dynamic
image or resources that aren't added with a IInitializer
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.id
- See ComponentresourceReference
- The shared image resourcepublic ImageButton(String id, ResourceReference resourceReference, PageParameters resourceParameters)
ResourceReference
. 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 a
Resource
that isn't guaranteed to be on every server, for example a dynamic
image or resources that aren't added with a IInitializer
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.id
- See ComponentresourceReference
- The shared image resourceresourceParameters
- The resource parameterspublic ImageButton(String id, IResource imageResource)
ResourceReference
constructor has. But this will result in a non 'stable' url
and the url will have request parameters.id
- See ComponentimageResource
- The image resourcepublic ImageButton(String id, IModel<String> model)
id
- model
- Component.Component(String, IModel)
public ImageButton(String id, String string)
id
- See Componentstring
- Name of imageComponent.Component(String, IModel)
public void onResourceRequested()
IResourceListener
onResourceRequested
in interface IResourceListener
IResourceListener.onResourceRequested()
public void setImageResource(IResource imageResource)
imageResource
- The new ImageResource to set.public void setImageResourceReference(ResourceReference resourceReference)
resourceReference
- The shared ImageResource to set.public void setImageResourceReference(ResourceReference resourceReference, PageParameters parameters)
resourceReference
- The shared ImageResource to set.parameters
- Set the resource parameters for the resource.public ImageButton setDefaultModel(IModel<?> model)
Component
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.
setDefaultModel
in class MarkupContainer
model
- The modelComponent.setDefaultModel(org.apache.wicket.model.IModel)
protected IResource getImageResource()
protected ResourceReference getImageResourceReference()
protected final void onComponentTag(ComponentTag tag)
onComponentTag
in class Button
tag
- Tag to modifyComponent.onComponentTag(ComponentTag)
protected boolean getStatelessHint()
Component
getStatelessHint
in class Component
Component.getStatelessHint()
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.