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

public class ImageButton extends Button implements IRequestListener
<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:
  • Constructor Details

    • ImageButton

      public ImageButton(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 Component
      resourceReference - The shared image resource
    • ImageButton

      public ImageButton(String id, ResourceReference resourceReference, PageParameters 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 Component
      resourceReference - The shared image resource
      resourceParameters - The resource parameters
    • ImageButton

      public ImageButton(String id, IResource 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 Component
      imageResource - The image resource
    • ImageButton

      public ImageButton(String id, IModel<String> model)
      Parameters:
      id -
      model -
      See Also:
    • ImageButton

      public ImageButton(String id, String string)
      Parameters:
      id - See Component
      string - Name of image
      See Also:
  • Method Details