com.taggercat.tags
Class HTMLCheckBoxElementTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.taggercat.tags.AbstractExpEvalTag
          extended by com.taggercat.tags.AbstractHTMLInputTag
              extended by com.taggercat.tags.HTMLCheckBoxElementTag
All Implemented Interfaces:
com.taggercat.el.ELPropertyResolver, java.io.Serializable, javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class HTMLCheckBoxElementTag
extends AbstractHTMLInputTag

This tag returns a HTML check box field for the named field for the data source.

The generated tag is automatically disabled if:

  1. the user does not have update permissions on the specified data source and field
  2. or there is no current tcEntity in the resultset of the specified data source
  3. or there is a condition expression, and it evaluates to false

If an error has occurred (usually preventing a save) on this request/response cycle then the data from the request, and not from the model is used. Therefore, the user will not lose the data they just entered when errors occur. If there is no corresponding parameter on the request, then the value from the data source is used.

See Also:
Serialized Form
 

Field Summary
 
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
HTMLCheckBoxElementTag()
           
 
Method Summary
 int doEndTag()
          Resets the tags internal state.
 int doStartTag()
          Starts the tag's processing.
 java.lang.String makeElement(Model model, DataSource ds, TCEntity tcEntity)
          Creates the HTML checkbox input element.
 void setIncludeHiddenElement(boolean includeHiddenElement)
          Sets the includeHiddenElement attribute property.
 void setValue(Model model, DataSource ds, TCEntity tcEntity)
          Sets the value property from the field name, or from the current request object if there was an update error.
 
Methods inherited from class com.taggercat.tags.AbstractHTMLInputTag
addBaseAttributes, addBaseEnabledAttributes, getAccesskey, getAjaxValidationJSFunction, getCondition, getDisabled, getDsn, getField, getName, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getRowID, getStyle, getStyleclass, getStyleid, getTabindex, getTitle, getValue, isQbf, isShowDisabled, isXHTMLtag, setAccesskey, setAjaxValidationJSFunction, setCondition, setDisabled, setDsn, setDynamicAttribute, setField, setFormat, setId, setName, setNulls, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setPreserveHTML, setQbf, setReadonly, setRowID, setShowDisabled, setStyle, setStyleclass, setStyleid, setTabindex, setTitle, setValue
 
Methods inherited from class com.taggercat.tags.AbstractExpEvalTag
getModel, resolveProperty, setScope, setVar
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLCheckBoxElementTag

public HTMLCheckBoxElementTag()
Method Detail

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Resets the tags internal state.

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

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Starts the tag's processing.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class AbstractHTMLInputTag
Throws:
javax.servlet.jsp.JspException
Returns:
SKIP_BODY

makeElement

public java.lang.String makeElement(Model model,
                                    DataSource ds,
                                    TCEntity tcEntity)
                             throws javax.servlet.jsp.JspException
Creates the HTML checkbox input element.

Throws:
javax.servlet.jsp.JspException
Parameters:
model - the model
ds - the data source
tcEntity - the tcEntity
Returns:
the HTML tag checkbox input element

setValue

public void setValue(Model model,
                     DataSource ds,
                     TCEntity tcEntity)
              throws javax.servlet.jsp.JspException
Sets the value property from the field name, or from the current request object if there was an update error.

Specified by:
setValue in class AbstractHTMLInputTag
Throws:
javax.servlet.jsp.JspException
Parameters:
model - the model
ds - the data source
tcEntity - the tcEntity

setIncludeHiddenElement

public void setIncludeHiddenElement(boolean includeHiddenElement)
Sets the includeHiddenElement attribute property. The default value is true. If this property is true then an additional hidden form element is generated for the checkbox. This allows the unselected state of the checkbox to be included in the request object.

Parameters:
includeHiddenElement - the includeHiddenElement state