net.sf.tacos.ajax.components
Class AjaxImageSubmit

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.form.AbstractFormComponent
              extended by net.sf.tacos.ajax.components.AbstractSubmit
                  extended by net.sf.tacos.ajax.components.AjaxImageSubmit
All Implemented Interfaces:
AjaxInvocation, AjaxSubmitInvocation, Locatable, LocationHolder, org.apache.tapestry.form.IFormComponent, org.apache.tapestry.IComponent, org.apache.tapestry.IRender

public abstract class AjaxImageSubmit
extends AbstractSubmit

A component that generates a clickable image that will cause the enclosing form to submit. The <input type="image"> form element was originally designed for use as a way to select a pixel within an image that was presumable a map; it has been co-opted by web applications as a way to decorate a form submit button using a custom image instead of ordinary clickable buttons. This component is simply an enhanced version of the Submit component that will display an image instead of a text label.

Author:
lquijano

Constructor Summary
AjaxImageSubmit()
           
 
Method Summary
 String getComponentId()
          The component Id used by script
abstract  org.apache.tapestry.IAsset getDisabledImage()
          Image to use when disabled.
 String getHiddenId()
          The hidden form field id
abstract  org.apache.tapestry.IAsset getImage()
          Image to use.
abstract  String getNameOverride()
          Overidden name.
abstract  org.apache.tapestry.IScript getScript()
           
protected  void handleClick(org.apache.tapestry.IRequestCycle cycle, org.apache.tapestry.IForm form)
          Handles button clicked events
protected  boolean isClicked(org.apache.tapestry.IRequestCycle cycle, String name)
          Determine if this submit component was clicked.
 boolean isDeferred()
          Causes initial event connection to be deferred
protected  void renderFormComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
           
protected  void setName(org.apache.tapestry.IForm form)
           
abstract  void setPoint(Point point)
          Set to the coordinates of the clicked point within the image.
 
Methods inherited from class net.sf.tacos.ajax.components.AbstractSubmit
constructScriptParameter, getAction, getAjaxLink, getDefer, getEncodingType, getFocusElement, getListener, getListenerInvoker, getParameters, getTag, rewindFormComponent, setSelected
 
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent
getAlwaysRenderBodyOnRewind, getCanTakeFocus, getForm, getIdParameter, getName, isRequired, renderComponent, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, renderIdAttribute, setClientId, setForm, setName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.tacos.ajax.AjaxSubmitInvocation
getFunctionName, isClientSideValidationEnabled, isSubmitNormal
 
Methods inherited from interface net.sf.tacos.ajax.AjaxInvocation
getAjaxEngine, getBackLink, getEffects, getForwardLink, getPopup, getPreEffects, getStatusElement, getUpdateComponents, getUpdateObject
 
Methods inherited from interface org.apache.tapestry.form.IFormComponent
getClientId, getDisplayName, isDisabled
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

AjaxImageSubmit

public AjaxImageSubmit()
Method Detail

getDisabledImage

public abstract org.apache.tapestry.IAsset getDisabledImage()
Image to use when disabled.


getImage

public abstract org.apache.tapestry.IAsset getImage()
Image to use.


getNameOverride

public abstract String getNameOverride()
Overidden name.


setPoint

public abstract void setPoint(Point point)
Set to the coordinates of the clicked point within the image.


getScript

public abstract org.apache.tapestry.IScript getScript()
Returns:
Script for processing client side.

setName

protected void setName(org.apache.tapestry.IForm form)
Overrides:
setName in class org.apache.tapestry.form.AbstractFormComponent
See Also:
AbstractFormComponent.setName( org.apache.tapestry.IForm)

handleClick

protected void handleClick(org.apache.tapestry.IRequestCycle cycle,
                           org.apache.tapestry.IForm form)
Handles button clicked events

Overrides:
handleClick in class AbstractSubmit

isClicked

protected boolean isClicked(org.apache.tapestry.IRequestCycle cycle,
                            String name)
Determine if this submit component was clicked.

Specified by:
isClicked in class AbstractSubmit
Returns:
true if this submit was clicked

renderFormComponent

protected void renderFormComponent(org.apache.tapestry.IMarkupWriter writer,
                                   org.apache.tapestry.IRequestCycle cycle)
Specified by:
renderFormComponent in class org.apache.tapestry.form.AbstractFormComponent
See Also:
AbstractFormComponent.renderFormComponent( IMarkupWriter, IRequestCycle)

getComponentId

public String getComponentId()
The component Id used by script

Returns:
component Id

getHiddenId

public String getHiddenId()
The hidden form field id

Returns:
hidden id

isDeferred

public boolean isDeferred()
Causes initial event connection to be deferred

Returns:
deferred