com.taggercat.tags
Class AbstractHTMLInputTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.taggercat.tags.AbstractExpEvalTag
          extended by com.taggercat.tags.AbstractHTMLInputTag
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:
HTMLCheckBoxElementTag, HTMLListMenuElementTag, HTMLRadioButtonsTag, HTMLTextElementTag

public abstract class AbstractHTMLInputTag
extends AbstractExpEvalTag
implements javax.servlet.jsp.tagext.DynamicAttributes

This tag is the abstract base class for HTML input elements. The element's enabled state is set according to the corresponding field access permissions set in the security data.

The hasUpdatePermission is set to false, and the disabled property is set true 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 the user does not have read access, then:

  1. the field value is set to an empty string
  2. the hasReadPermission property of this instance is set to false

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
AbstractHTMLInputTag()
           
 
Method Summary
 HTMLTagBuilder addBaseAttributes(HTMLTagBuilder htmlTag)
          Fills in the base attributes that are common to both buttons and anchor tags.
 HTMLTagBuilder addBaseEnabledAttributes(HTMLTagBuilder htmlTag)
          Fills in the base attributes that are common to both buttons and anchor tags.
 int doEndTag()
          Reset the state of the tag.
 int doStartTag()
          Check the users permissions on the associated data field, and enable or disable the field.
 java.lang.String getAccesskey()
          Gets the access key.
static java.lang.String getAjaxValidationJSFunction()
           
 java.lang.String getCondition()
          Gets additional enabled condition.
 boolean getDisabled()
          Gets the disabled state.
 java.lang.String getDsn()
          Gets the data soruce name.
 java.lang.String getField()
          Gets the field name attribute.
 java.lang.String getName()
          Gets the buttons name.
 java.lang.String getOnblur()
          Gets the onblur javascript event handler.
 java.lang.String getOnchange()
          Gets the onchange attribute.
 java.lang.String getOnclick()
          Gets the onclick javascript event handler.
 java.lang.String getOndblclick()
          Gets the onfocus javascript event handler.
 java.lang.String getOnfocus()
          Gets the onfocus javascript event handler.
 java.lang.String getOnkeydown()
          Gets the onkeydown javascript event handler.
 java.lang.String getOnkeypress()
          Gets the onkeypress javascript event handler.
 java.lang.String getOnkeyup()
          Gets the onkeyup javascript event handler.
 java.lang.String getOnmousedown()
          Gets the onmousedown javascript event handler.
 java.lang.String getOnmousemove()
          Gets the onmousemove javascript event handler.
 java.lang.String getOnmouseout()
          Gets the onmouseout javascript event handler.
 java.lang.String getOnmouseover()
          Gets the onmouseover javascript event handler.
 java.lang.String getOnmouseup()
          Gets the onmouseup javascript event handler.
 java.lang.String getOnselect()
          Gets the onselect attribute.
 java.lang.String getRowID()
           
 java.lang.String getStyle()
          Gets the CSS Style.
 java.lang.String getStyleclass()
          Gets the CSS style class.
 java.lang.String getStyleid()
          Gets the CSS Style ID.
 java.lang.String getTabindex()
          Gets the tab index.
 java.lang.String getTitle()
          Gets the title attribute.
 java.lang.String getValue()
          Gets the value attribute.
 boolean isQbf()
           
 boolean isShowDisabled()
          Controls if the element should be shown when the action is disabled, or not shown at all.
static java.lang.Boolean isXHTMLtag()
           
 void setAccesskey(java.lang.String accesskey)
          Sets the accesskey attribute.
static void setAjaxValidationJSFunction(java.lang.String ajaxValidationJSFunction)
           
 void setCondition(java.lang.String condition)
          Sets the condition attribute.
 void setDisabled(boolean disabled)
          Sets the disabled attribute.
 void setDsn(java.lang.String dsn)
          Set the name of the data source this field is a member of.
 void setDynamicAttribute(java.lang.String uri, java.lang.String localName, java.lang.Object value)
           
 void setField(java.lang.String field)
          Sets the field name attribute.
 void setFormat(java.lang.String format)
          Sets the format string.
 void setId(java.lang.String idAttr)
          Sets the idAttr attribute.
 void setName(java.lang.String name)
          Sets the name attribute.
 void setNulls(java.lang.String nulls)
          Sets the null representation.
 void setOnblur(java.lang.String onblur)
          Sets the onblur attribute.
 void setOnchange(java.lang.String onchange)
          Sets the onchange attribute.
 void setOnclick(java.lang.String onclick)
          Sets the onclick attribute.
 void setOndblclick(java.lang.String ondblclick)
          Sets the ondblclick attribute.
 void setOnfocus(java.lang.String onfocus)
          Sets the onfocus attribute.
 void setOnkeydown(java.lang.String onkeydown)
          Sets the onkeydown attribute.
 void setOnkeypress(java.lang.String onkeypress)
          Sets the onkeypress attribute.
 void setOnkeyup(java.lang.String onkeyup)
          Sets the onkeyup attribute.
 void setOnmousedown(java.lang.String onmousedown)
          Sets the onmousedown attribute.
 void setOnmousemove(java.lang.String onmousemove)
          Sets the onmousemove attribute.
 void setOnmouseout(java.lang.String onmouseout)
          Sets the onmouseout attribute.
 void setOnmouseover(java.lang.String onmouseover)
          Sets the onmouseover attribute.
 void setOnmouseup(java.lang.String onmouseup)
          Sets the onmouseup attribute.
 void setOnselect(java.lang.String onselect)
          Sets the onselect attribute.
 void setPreserveHTML(boolean preserveHTML)
          Sets the preserveHTML field, set true to retain the original HTML.
 void setQbf(boolean qbf)
           
 void setReadonly(boolean readonly)
          Sets the readonly tag attribute.
 void setRowID(java.lang.String rowID)
           
 void setShowDisabled(boolean showDisabled)
          Sets the show disabled attribute.
 void setStyle(java.lang.String style)
          Sets the CSS style attribute.
 void setStyleclass(java.lang.String styleclass)
          Sets the CSS style class attribute.
 void setStyleid(java.lang.String styleid)
          Sets the CSS styleid attribute.
 void setTabindex(java.lang.String tabindex)
          Sets the tabindex attribute.
 void setTitle(java.lang.String title)
          Sets the title attribute.
abstract  void setValue(Model model, DataSource ds, TCEntity tcEntity)
          Sets the value field and attribute.
 void setValue(java.lang.String value)
          Sets the value attribute.
 
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

AbstractHTMLInputTag

public AbstractHTMLInputTag()
Method Detail

addBaseAttributes

public HTMLTagBuilder addBaseAttributes(HTMLTagBuilder htmlTag)
Fills in the base attributes that are common to both buttons and anchor tags.

Parameters:
htmlTag - the html tag to add the base attributes to

addBaseEnabledAttributes

public HTMLTagBuilder addBaseEnabledAttributes(HTMLTagBuilder htmlTag)
Fills in the base attributes that are common to both buttons and anchor tags.

Parameters:
htmlTag - the html tag to add the base enabled attributes to

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Reset the state of the tag.

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

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Check the users permissions on the associated data field, and enable or disable the field. If the user does not have even read access then the field is not shown at all.

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

setValue

public abstract void setValue(Model model,
                              DataSource ds,
                              TCEntity tcEntity)
                       throws javax.servlet.jsp.JspException
Sets the value field and attribute.

Throws:
javax.servlet.jsp.JspException
Parameters:
model - the model
ds - the data source the field applies to
tcEntity - the TCEntity

getAccesskey

public java.lang.String getAccesskey()
Gets the access key.

Returns:
the access key

getCondition

public java.lang.String getCondition()
Gets additional enabled condition.

Returns:
additional enabled condition

getDisabled

public boolean getDisabled()
Gets the disabled state.

Returns:
the disabled state

getDsn

public java.lang.String getDsn()
Gets the data soruce name.

Returns:
the name of the data source the operation applies to

getName

public java.lang.String getName()
Gets the buttons name.

Returns:
the buttons name

getOnblur

public java.lang.String getOnblur()
Gets the onblur javascript event handler.

Returns:
the onblur javascript event handler

getOnclick

public java.lang.String getOnclick()
Gets the onclick javascript event handler.

Returns:
the onclick javascript event handler

getOndblclick

public java.lang.String getOndblclick()
Gets the onfocus javascript event handler.

Returns:
the onfocus javascript event handler

getOnfocus

public java.lang.String getOnfocus()
Gets the onfocus javascript event handler.

Returns:
the onfocus javascript event handler

getOnkeydown

public java.lang.String getOnkeydown()
Gets the onkeydown javascript event handler.

Returns:
the onkeydown javascript event handler

getOnkeypress

public java.lang.String getOnkeypress()
Gets the onkeypress javascript event handler.

Returns:
the onkeypress javascript event handler

getOnkeyup

public java.lang.String getOnkeyup()
Gets the onkeyup javascript event handler.

Returns:
the onkeyup javascript event handler

getOnmousedown

public java.lang.String getOnmousedown()
Gets the onmousedown javascript event handler.

Returns:
the onmousedown javascript event handler

getOnmousemove

public java.lang.String getOnmousemove()
Gets the onmousemove javascript event handler.

Returns:
the onmousemove javascript event handler

getOnmouseout

public java.lang.String getOnmouseout()
Gets the onmouseout javascript event handler.

Returns:
the onmouseout javascript event handler

getOnmouseover

public java.lang.String getOnmouseover()
Gets the onmouseover javascript event handler.

Returns:
the onmouseover javascript event handler

getOnmouseup

public java.lang.String getOnmouseup()
Gets the onmouseup javascript event handler.

Returns:
the onmouseup javascript event handler

setField

public void setField(java.lang.String field)
Sets the field name attribute.

Parameters:
field - The new field value

getField

public java.lang.String getField()
Gets the field name attribute.

Returns:
the field name attribute

setFormat

public void setFormat(java.lang.String format)
Sets the format string.

Parameters:
format - The new format value

setNulls

public void setNulls(java.lang.String nulls)
Sets the null representation.

Parameters:
nulls - the new null representation

setPreserveHTML

public void setPreserveHTML(boolean preserveHTML)
Sets the preserveHTML field, set true to retain the original HTML.

Parameters:
preserveHTML - the new preserveHTML state

getOnchange

public java.lang.String getOnchange()
Gets the onchange attribute.

Returns:
the onchange value

getOnselect

public java.lang.String getOnselect()
Gets the onselect attribute.

Returns:
the onselect value

getStyle

public java.lang.String getStyle()
Gets the CSS Style.

Returns:
the name of the CSS Style

getStyleclass

public java.lang.String getStyleclass()
Gets the CSS style class.

Returns:
the name of the CSS style class

getStyleid

public java.lang.String getStyleid()
Gets the CSS Style ID.

Returns:
the CSS style ID

getTabindex

public java.lang.String getTabindex()
Gets the tab index.

Returns:
the tab index

getTitle

public java.lang.String getTitle()
Gets the title attribute.

Returns:
the title set for the element

getValue

public java.lang.String getValue()
Gets the value attribute.

Returns:
the value used for the element

isShowDisabled

public boolean isShowDisabled()
Controls if the element should be shown when the action is disabled, or not shown at all.

Returns:
true if the element should be shown when it is disabled.

setAccesskey

public void setAccesskey(java.lang.String accesskey)
Sets the accesskey attribute.

Parameters:
accesskey - the new accesskey value

setCondition

public void setCondition(java.lang.String condition)
Sets the condition attribute.

Parameters:
condition - the new condition value

setOnchange

public void setOnchange(java.lang.String onchange)
Sets the onchange attribute.

Parameters:
onchange - the new onchange value

setOnselect

public void setOnselect(java.lang.String onselect)
Sets the onselect attribute.

Parameters:
onselect - the new onselect value

setDisabled

public void setDisabled(boolean disabled)
Sets the disabled attribute.

Parameters:
disabled - the new disabled value

setDsn

public void setDsn(java.lang.String dsn)
Set the name of the data source this field is a member of.

Parameters:
dsn - the data source name

setName

public void setName(java.lang.String name)
Sets the name attribute.

Parameters:
name - the new name value

setOnblur

public void setOnblur(java.lang.String onblur)
Sets the onblur attribute.

Parameters:
onblur - the new onblur value

setOnclick

public void setOnclick(java.lang.String onclick)
Sets the onclick attribute.

Parameters:
onclick - the new onclick value

setOndblclick

public void setOndblclick(java.lang.String ondblclick)
Sets the ondblclick attribute.

Parameters:
ondblclick - the new ondblclick value

setOnfocus

public void setOnfocus(java.lang.String onfocus)
Sets the onfocus attribute.

Parameters:
onfocus - the new onfocus value

setOnkeydown

public void setOnkeydown(java.lang.String onkeydown)
Sets the onkeydown attribute.

Parameters:
onkeydown - the new onkeydown value

setOnkeypress

public void setOnkeypress(java.lang.String onkeypress)
Sets the onkeypress attribute.

Parameters:
onkeypress - the new onkeypress value

setOnkeyup

public void setOnkeyup(java.lang.String onkeyup)
Sets the onkeyup attribute.

Parameters:
onkeyup - the new onkeyup value

setOnmousedown

public void setOnmousedown(java.lang.String onmousedown)
Sets the onmousedown attribute.

Parameters:
onmousedown - the new onmousedown value

setOnmousemove

public void setOnmousemove(java.lang.String onmousemove)
Sets the onmousemove attribute.

Parameters:
onmousemove - the new onmousemove value

setOnmouseout

public void setOnmouseout(java.lang.String onmouseout)
Sets the onmouseout attribute.

Parameters:
onmouseout - the new onmouseout value

setOnmouseover

public void setOnmouseover(java.lang.String onmouseover)
Sets the onmouseover attribute.

Parameters:
onmouseover - the new onmouseover value

setOnmouseup

public void setOnmouseup(java.lang.String onmouseup)
Sets the onmouseup attribute.

Parameters:
onmouseup - the new onmouseup value

setReadonly

public void setReadonly(boolean readonly)
Sets the readonly tag attribute.

Parameters:
readonly - the new readonly value

setShowDisabled

public void setShowDisabled(boolean showDisabled)
Sets the show disabled attribute. If it is set to true, then disabled option elements will be displayed. The default is true.

Parameters:
showDisabled - the new disabled value

setStyle

public void setStyle(java.lang.String style)
Sets the CSS style attribute.

Parameters:
style - the new style value

setStyleclass

public void setStyleclass(java.lang.String styleclass)
Sets the CSS style class attribute.

Parameters:
styleclass - the new styleclass value

setStyleid

public void setStyleid(java.lang.String styleid)
Sets the CSS styleid attribute. In keeping with Struts; there is some historical reasons for this, please be kind....

Parameters:
styleid - the new styleid value

setTabindex

public void setTabindex(java.lang.String tabindex)
Sets the tabindex attribute.

Parameters:
tabindex - the new tabindex value

setTitle

public void setTitle(java.lang.String title)
Sets the title attribute.

Parameters:
title - the new title value

setId

public void setId(java.lang.String idAttr)
Sets the idAttr attribute.

Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport
Parameters:
idAttr - the new idAttr value

setValue

public void setValue(java.lang.String value)
Sets the value attribute.

Overrides:
setValue in class AbstractExpEvalTag
Parameters:
value - the new value

isXHTMLtag

public static java.lang.Boolean isXHTMLtag()

isQbf

public boolean isQbf()

setQbf

public void setQbf(boolean qbf)

getAjaxValidationJSFunction

public static java.lang.String getAjaxValidationJSFunction()

setAjaxValidationJSFunction

public static void setAjaxValidationJSFunction(java.lang.String ajaxValidationJSFunction)

getRowID

public java.lang.String getRowID()
Returns:
the rowID

setRowID

public void setRowID(java.lang.String rowID)
Parameters:
rowID - the rowID to set

setDynamicAttribute

public void setDynamicAttribute(java.lang.String uri,
                                java.lang.String localName,
                                java.lang.Object value)
                         throws javax.servlet.jsp.JspException
Specified by:
setDynamicAttribute in interface javax.servlet.jsp.tagext.DynamicAttributes
Throws:
javax.servlet.jsp.JspException