Class ImageButton

    • Constructor Detail

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

        public ImageButton​(java.lang.String id,
                           ResourceReference resourceReference,
                           org.apache.wicket.request.mapper.parameter.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​(java.lang.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​(java.lang.String id,
                           java.lang.String string)
        Parameters:
        id - See Component
        string - Name of image
        See Also:
        Component(String, IModel)
    • Method Detail

      • onRequest

        public void onRequest()
        Description copied from interface: IRequestListener
        Called when a request is received.
        Specified by:
        onRequest in interface IRequestListener
        See Also:
        org.apache.wicket.IResourceListener#onResourceRequested()
      • setImageResource

        public void setImageResource​(IResource 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,
                                              org.apache.wicket.request.mapper.parameter.PageParameters parameters)
        Parameters:
        resourceReference - The shared ImageResource to set.
        parameters - Set the resource parameters for the resource.
      • getImageResource

        protected IResource getImageResource()
        Returns:
        Resource returned from subclass
      • getImageResourceReference

        protected ResourceReference getImageResourceReference()
        Returns:
        ResourceReference returned from subclass
      • 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()