net.ontopia.topicmaps.webed.taglibs.form
Class ButtonTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by net.ontopia.topicmaps.webed.taglibs.form.ButtonTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag, ActionInvokingTagIF

public class ButtonTag
extends javax.servlet.jsp.tagext.TagSupport
implements ActionInvokingTagIF

INTERNAL: Custom tag that represents an graphical submit button in an input form.

See Also:
Serialized Form

Field Summary
protected  String action_name
           
protected  String button_text
           
protected  String id
           
protected  String image_name
           
protected  String klass
           
protected  String params
           
protected  String readonly
           
protected  String reset_button
           
protected  List sub_actions
           
protected static String TEMPLATE_FILE
          The location where the velocity template can be retrieved from.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ButtonTag()
           
 
Method Summary
 void addAction(ActionData action)
          Accepts the action and adds it to the list of actions to be invoked together with the primary action.
 int doEndTag()
          Generate the button.
 int doStartTag()
          Process the start tag, do nothing.
 void release()
          Release any acquired resources.
 void setAction(String action_name)
          Sets the name of the related action (required).
 void setClass(String klass)
          Sets the class attribute of the tag.
 void setId(String id)
          Sets the id of the tag.
 void setImage(String image_name)
          Sets the name of the image that should be displayed as graphical representation of this button.
 void setParams(String params)
          Sets the variable name(s) of the parameter(s) transmitted to the action separated by whitespaces (optional).
 void setReadonly(String readonly)
          Sets the the readonly flag of the tag.
 void setReset(String reset_button)
          Sets the button behaviour to reset (allowed values are "yes" and "no").
 void setText(String button_text)
          Sets the text that should be displayed inside the button.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_FILE

protected static final String TEMPLATE_FILE
The location where the velocity template can be retrieved from.

See Also:
Constant Field Values

id

protected String id

readonly

protected String readonly

klass

protected String klass

action_name

protected String action_name

params

protected String params

image_name

protected String image_name

button_text

protected String button_text

reset_button

protected String reset_button

sub_actions

protected List sub_actions
Constructor Detail

ButtonTag

public ButtonTag()
Method Detail

doStartTag

public int doStartTag()
Process the start tag, do nothing.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
EVAL_BODY_INCLUDE

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Generate the button.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

release

public void release()
Release any acquired resources.

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport

addAction

public void addAction(ActionData action)
Description copied from interface: ActionInvokingTagIF
Accepts the action and adds it to the list of actions to be invoked together with the primary action.

Specified by:
addAction in interface ActionInvokingTagIF

setId

public void setId(String id)
Sets the id of the tag. This value will be used as the value of an ID attribute in the generated output.

Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport

setReadonly

public void setReadonly(String readonly)
Sets the the readonly flag of the tag.


setClass

public void setClass(String klass)
Sets the class attribute of the tag. This value will be used as the value of the 'class' attribute in the generated output.


setAction

public void setAction(String action_name)
Sets the name of the related action (required).


setParams

public void setParams(String params)
Sets the variable name(s) of the parameter(s) transmitted to the action separated by whitespaces (optional).


setText

public void setText(String button_text)
Sets the text that should be displayed inside the button.

Note: 'image' OR 'text' property has to be specified.


setImage

public void setImage(String image_name)
Sets the name of the image that should be displayed as graphical representation of this button.

Note: 'image' OR 'text' property has to be specified.


setReset

public void setReset(String reset_button)
Sets the button behaviour to reset (allowed values are "yes" and "no").

Note: If 'reset' is not set, "submit" will be the default behaviour.



Copyright © 2000-2012 Ontopia.