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_SEPARATORENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEINGINTERFACE| 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, onError, onSubmit, setDefaultFormProcessing, updateModeladd, add, checkRequired, clearInput, convertInput, convertValue, error, getConvertedInput, getDefaultLabel, getDefaultLabel, getInput, getInputAsArray, getInputName, getModel, getModelObject, getModelValue, 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, visitFormComponentsPostOrdergetLabelgetWebPage, getWebRequest, getWebResponse, getWebSessionadd, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, 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, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onConfigure, onEvent, onModelChanged, onModelChanging, 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, wrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInputNamepublic 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()
IResourceListeneronResourceRequested in interface IResourceListenerIResourceListener.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)
ComponentWARNING: 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 MarkupContainermodel - The modelComponent.setDefaultModel(org.apache.wicket.model.IModel)protected IResource getImageResource()
protected ResourceReference getImageResourceReference()
protected final void onComponentTag(ComponentTag tag)
onComponentTag in class Buttontag - Tag to modifyComponent.onComponentTag(ComponentTag)protected boolean getStatelessHint()
ComponentgetStatelessHint in class ComponentComponent.getStatelessHint()Copyright © 2006–2014 Apache Software Foundation. All rights reserved.