com.taggercat.tags
Class HTMLTextElementTag

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.HTMLTextElementTag
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
Direct Known Subclasses:
HTMLTextAreaElementTag

public class HTMLTextElementTag
extends AbstractHTMLInputTag

This tag returns a HTML text input element with the value that of the named field of the data source.

The generated text field element is automatically disabled if:

  1. the user does not have update permissions on the specified data source and field
  2. or there is no 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
HTMLTextElementTag()
           
 
Method Summary
 int doEndTag()
          Resets the tags internal state.
 boolean isPassword()
           
 java.lang.String makeElement(Model model, DataSource ds, TCEntity tcEntity)
          Creates the HTML Text input element.
 void setMaxlength(int maxlength)
          Sets the max length attribute.
 void setPassword(boolean password)
           
 void setSize(int size)
          Sets the size field.
 void setValue(Model model, DataSource ds, TCEntity tcEntity)
          Sets the value field of the element from the value of the associated data field.
 
Methods inherited from class com.taggercat.tags.AbstractHTMLInputTag
addBaseAttributes, addBaseEnabledAttributes, doStartTag, 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

HTMLTextElementTag

public HTMLTextElementTag()
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

makeElement

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

Throws:
javax.servlet.jsp.JspException
Parameters:
model - the model
ds - the data source
tcEntity - the tcEntity
Returns:
the completed HTML text element

setSize

public void setSize(int size)
Sets the size field.

Parameters:
size - the size ( in characters )

setValue

public void setValue(Model model,
                     DataSource ds,
                     TCEntity tcEntity)
              throws javax.servlet.jsp.JspException
Sets the value field of the element from the value of the associated data field.

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

setMaxlength

public void setMaxlength(int maxlength)
Sets the max length attribute.

Parameters:
maxlength - the max length

isPassword

public boolean isPassword()

setPassword

public void setPassword(boolean password)