org.apache.wicket.markup.html.form
Class ImageButton
java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.form.LabeledWebMarkupContainer
org.apache.wicket.markup.html.form.FormComponent<java.lang.String>
org.apache.wicket.markup.html.form.Button
org.apache.wicket.markup.html.form.ImageButton
- All Implemented Interfaces:
- java.io.Serializable, IClusterable, IConverterLocator, IRequestListener, IResourceListener, IFormModelUpdateListener, IFormSubmittingComponent, IFormVisitorParticipant, ILabelProvider<java.lang.String>
public class ImageButton
- extends Button
- implements IResourceListener
<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:
- Serialized Form
Fields inherited from class org.apache.wicket.Component |
ENABLE, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
Constructor Summary |
ImageButton(java.lang.String id)
This constructor can be used if you have an img tag that has a src
that points to a PackageResource (which will be created and bind to the shared
resources) or if you have a value attribute in your tag for which the image
factory can make an image. |
ImageButton(java.lang.String id,
IModel<java.lang.String> model)
|
ImageButton(java.lang.String id,
Resource imageResource)
Constructs an image directly from an image resource. |
ImageButton(java.lang.String id,
ResourceReference resourceReference)
Constructs an image button from an image ResourceReference . |
ImageButton(java.lang.String id,
ResourceReference resourceReference,
ValueMap resourceParameters)
Constructs an image button from an image ResourceReference . |
ImageButton(java.lang.String id,
java.lang.String string)
|
Methods inherited from class org.apache.wicket.markup.html.form.FormComponent |
add, add, checkRequired, clearInput, convertInput, convertValue, error, getConvertedInput, getForm, getInput, getInputAsArray, getInputName, getModel, getModelObject, getModelValue, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isMultiPart, isPersistent, isRequired, isValid, newValidatable, onDetach, onDisabled, onInvalid, onValid, processChildren, processInput, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setModelValue, setPersistent, setRequired, setType, shouldTrimInput, supportsPersistence, trim, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrder |
Methods inherited from class org.apache.wicket.MarkupContainer |
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren |
Methods inherited from class org.apache.wicket.Component |
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdImpl, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, internalAttach, internalDetach, internalOnAttach, internalOnDetach, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onEndRequest, onModelChanged, onModelChanging, onRemove, prepareForRender, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ImageButton
public ImageButton(java.lang.String id)
- This constructor can be used if you have an
img
tag that has a src
that points to a PackageResource
(which will be created and bind to the shared
resources) or if you have a value
attribute in your tag for which the image
factory can make an image.
- See Also:
Component.Component(String)
ImageButton
public ImageButton(java.lang.String id,
ResourceReference resourceReference)
- Constructs an image button from an image
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.
- Parameters:
id
- See ComponentresourceReference
- The shared image resource
ImageButton
public ImageButton(java.lang.String id,
ResourceReference resourceReference,
ValueMap resourceParameters)
- Constructs an image button from an image
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.
- Parameters:
id
- See ComponentresourceReference
- The shared image resourceresourceParameters
- The resource parameters
ImageButton
public ImageButton(java.lang.String id,
Resource imageResource)
- Constructs an image directly from an image resource.
This one doesn't have the 'non sticky session clustering' problem that the
ResourceReference
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
public ImageButton(java.lang.String id,
IModel<java.lang.String> model)
- Parameters:
id
- model
- - See Also:
Component.Component(String, IModel)
ImageButton
public ImageButton(java.lang.String id,
java.lang.String string)
- Parameters:
id
- See Componentstring
- Name of image- See Also:
Component.Component(String, IModel)
onResourceRequested
public void onResourceRequested()
- Description copied from interface:
IResourceListener
- Called when a resource is requested.
- Specified by:
onResourceRequested
in interface IResourceListener
- See Also:
IResourceListener.onResourceRequested()
setImageResource
public void setImageResource(Resource imageResource)
- Parameters:
imageResource
- The new ImageResource to set.
setImageResourceReference
public void setImageResourceReference(ResourceReference resourceReference)
- Parameters:
resourceReference
- The shared ImageResource to set.
setImageResourceReference
public void setImageResourceReference(ResourceReference resourceReference,
ValueMap parameters)
- Parameters:
resourceReference
- The shared ImageResource to set.parameters
- Set the resource parameters for the resource.
setDefaultModel
public ImageButton setDefaultModel(IModel<?> model)
- 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.
- Overrides:
setDefaultModel
in class MarkupContainer
- Parameters:
model
- The model
- Returns:
- This
- See Also:
Component.setDefaultModel(org.apache.wicket.model.IModel)
getImageResource
protected Resource getImageResource()
- Returns:
- Resource returned from subclass
getImageResourceReference
protected ResourceReference getImageResourceReference()
- Returns:
- ResourceReference returned from subclass
onComponentTag
protected final void onComponentTag(ComponentTag tag)
- Processes the component tag.
- Overrides:
onComponentTag
in class Button
- Parameters:
tag
- Tag to modify- See Also:
Component.onComponentTag(ComponentTag)
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 class Component
- Returns:
- whether the component can be stateless
- See Also:
Component.getStatelessHint()
Copyright © 2004-2009 Apache Software Foundation. All Rights Reserved.