org.apache.tapestry.form
Class ImageSubmit

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 org.apache.tapestry.form.Submit
                  extended by org.apache.tapestry.form.ImageSubmit
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IFormComponent, IComponent, IDirectEvent, IDynamicInvoker, Component, IRender

public abstract class ImageSubmit
extends Submit

Used to create an image button inside a Form. Although it is occasionally useful to know the Pointon the image that was clicked (i.e., use the image as a kind of image map, which was the original intent of the HTML element), it is more commonly used to provide a graphic image for the user to click, rather than the rather plain <input type=submit>. [ Component Reference ]

Author:
Howard Lewis Ship

Field Summary
 
Fields inherited from class org.apache.tapestry.AbstractComponent
_body, _bodyCount
 
Constructor Summary
ImageSubmit()
           
 
Method Summary
abstract  IActionListener getAction()
          parameter.
abstract  boolean getDefer()
          parameter.
abstract  IEngineService getDirectService()
          Injected.
abstract  IAsset getDisabledImage()
          parameter.
abstract  IAsset getImage()
          parameter.
abstract  IActionListener getListener()
          parameter.
abstract  ListenerInvoker getListenerInvoker()
          Injected.
abstract  String getNameOverride()
          parameter.
abstract  Object getParameters()
          parameter.
abstract  IScript getSubmitScript()
          Injected.
abstract  String getSubmitType()
          The type of submission, normal/cancel/refresh.
abstract  Object getTag()
          parameter.
abstract  List getUpdateComponents()
          If set, will be used to update/refresh portions of a response during XHR requests.
abstract  boolean isAsync()
          Used to specify whether or not the result of this invocation should be returned asynchronously or use normal browser page reload semantics.
protected  boolean isClicked(IRequestCycle cycle, String name)
          Determine if this submit component was clicked.
abstract  boolean isJson()
          Used to specify that the return invocation of the response created should be in the "http://json.org" format.
protected  void prepareForRender(IRequestCycle cycle)
          Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)to prepare the component to render.
protected  void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
          Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle) to render the component.
protected  void renderSubmitBindings(IMarkupWriter writer, IRequestCycle cycle)
          Manages rendering of important submit client side bindings, like invoking the right submit type or any of the optional IDynamicInvoker parameters.
protected  void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)
          Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle) to rewind the component.
protected  void setName(IForm form)
           
abstract  void setPoint(Point point)
          parameter.
abstract  void setSelected(Object tag)
          parameter.
 
Methods inherited from class org.apache.tapestry.form.Submit
getLabel
 
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent
generateClientId, getCanTakeFocus, getForm, getIdParameter, getName, getRenderBodyOnRewind, isRequired, peekClientId, renderComponent, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, setForm, setName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, equals, finishLoad, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getBoundId, getClientId, getComponent, getComponents, getContainedComponent, getContainedRenderers, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getInnerRenderers, getListeners, getMessages, getNamespace, getPage, getRenderWorker, getSpecification, getSpecifiedId, getTemplateTagName, hasEvents, hashCode, isInActiveState, isParameterBound, isRendering, isStateful, pageEndRender, render, renderBody, renderIdAttribute, renderInformalParameters, setBinding, setClientId, setContainedComponent, setContainer, setHasEvents, setId, setNamespace, setPage, setTemplateTagName, toString, triggerEvent
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
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, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName
 
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

ImageSubmit

public ImageSubmit()
Method Detail

setName

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

isClicked

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

Overrides:
isClicked in class Submit
Parameters:
cycle - The current request.
name - The name of this form element.
Returns:
true if this submit was clicked

renderFormComponent

protected void renderFormComponent(IMarkupWriter writer,
                                   IRequestCycle cycle)
Description copied from class: AbstractFormComponent
Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle) to render the component.

Overrides:
renderFormComponent in class Submit
See Also:
AbstractFormComponent.renderFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

getDisabledImage

public abstract IAsset getDisabledImage()
parameter.


getImage

public abstract IAsset getImage()
parameter.


getNameOverride

public abstract String getNameOverride()
parameter.


setPoint

public abstract void setPoint(Point point)
parameter.


prepareForRender

protected void prepareForRender(IRequestCycle cycle)
Description copied from class: AbstractComponent
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)to prepare the component to render. This implementation sets JavaBeans properties from matching bound parameters. The default implementation of this method is empty.

Overrides:
prepareForRender in class AbstractComponent

rewindFormComponent

protected void rewindFormComponent(IMarkupWriter writer,
                                   IRequestCycle cycle)
Description copied from class: AbstractFormComponent
Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle) to rewind the component. If the component is disabled this will not be invoked.

Specified by:
rewindFormComponent in class AbstractFormComponent
See Also:
AbstractFormComponent.rewindFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

renderSubmitBindings

protected void renderSubmitBindings(IMarkupWriter writer,
                                    IRequestCycle cycle)
Manages rendering of important submit client side bindings, like invoking the right submit type or any of the optional IDynamicInvoker parameters.

Parameters:
writer - The writer to use to write content.
cycle - The current request cycle.

getListener

public abstract IActionListener getListener()
parameter.


getAction

public abstract IActionListener getAction()
parameter.


getTag

public abstract Object getTag()
parameter.


setSelected

public abstract void setSelected(Object tag)
parameter.


getDefer

public abstract boolean getDefer()
parameter.


getParameters

public abstract Object getParameters()
parameter.


getSubmitType

public abstract String getSubmitType()
The type of submission, normal/cancel/refresh.


getUpdateComponents

public abstract List getUpdateComponents()
If set, will be used to update/refresh portions of a response during XHR requests.

For instance, if you have a page listing projects and you wanted to update an Any components contents whenever one of the project links was clicked you would use a DirectLink with the parameters:

      updateComponents="{'projectDetails'}"
      async="true"
 

Specified by:
getUpdateComponents in interface IDynamicInvoker
Returns:
The list of components to update, if any.

isAsync

public abstract boolean isAsync()
Used to specify whether or not the result of this invocation should be returned asynchronously or use normal browser page reload semantics.

Async being true means responses will be encoded as XML using XmlHttpRequests. If you would like your request/response to be in another format - like JSON - you must also specify the additional parameter IDynamicInvoker.isJson(). Without setting the IDynamicInvoker.getUpdateComponents() parameter this parameter is pretty useless.

Specified by:
isAsync in interface IDynamicInvoker
Returns:
True if invocation should be processed asynchronously.
See Also:
IDynamicInvoker.isJson()

isJson

public abstract boolean isJson()
Used to specify that the return invocation of the response created should be in the "http://json.org" format. Without setting the IDynamicInvoker.getUpdateComponents() parameter this parameter is pretty useless.

Specified by:
isJson in interface IDynamicInvoker
Returns:
True if response should be encoded using JSON semantics.
See Also:
org.apache.tapestry.IJSONRender}

getDirectService

public abstract IEngineService getDirectService()
Injected.


getListenerInvoker

public abstract ListenerInvoker getListenerInvoker()
Injected.


getSubmitScript

public abstract IScript getSubmitScript()
Injected.



Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.