org.dbforms.taglib
Class DbBaseHandlerTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.dbforms.taglib.TagSupportWithScriptHandler
              extended by org.dbforms.taglib.DbBaseHandlerTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
CewolfCategoryDataTag, CewolfPieDataTag, DbAssociatedRadioTag, DbBaseButtonTag, DbBaseInputTag, DbBlobContentTag, DbBlobURLTag, DbBodyTag, DbCheckboxTag, DbDataContainerLabelTag, DbFilterTag, DbFilterValueTag, DbFooterTag, DbHeaderTag, DbLabelTag, DbLinkPositionItemTag, DbLinkURLTag, DbPosTag, DbRadioTag, DbSearchTag, DbSelectTag, DbSetDataSource, DbSortTag, EmbeddedData, HasMoreRecordsTag, HasNoRecordsTag, HasRecordsTag, IsWebEvent, StaticDataItem, TextFormatTag, TextFormatterUtil

public abstract class DbBaseHandlerTag
extends TagSupportWithScriptHandler

Base class for db-tags that render form data-elements capable of including JavaScript event handlers and/or CSS Style attributes.

Furthermore, this base class provides base functionality for DataBase driven form widgets: it initializes the associated DbFormsConfig and provides various field-properties & methods (i.e getFormFieldName and getFormFieldValue)

the html/css releated properties and methods where originally done by Don Clasen for Apache Groups's Jakarta-Struts project.

Added support for Custom Formatter class, see SetCustomFormatter.java Author Neal Katz .

Added support for overrideFormFieldName attribute. useful when working with customcontrollers. Author Neal Katz .

orginally done by Don Clasen

Author:
Joe Peer (modified and extended this class for use in DbForms-Project)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
DbBaseHandlerTag()
           
 
Method Summary
protected  String customFormat(String s)
          DOCUMENT ME!
 void doFinally()
          DOCUMENT ME!
protected  String escapeHTML(String html)
          Just a shortcut for calling the escaper
protected  String getCustomFormatter()
          DOCUMENT ME!
 String getDefaultValue()
          "value" is only used if parent tag is in "insert-mode" (footer, etc.)
 IEscaper getEscaper()
          DOCUMENT ME!
 String getEscaperClass()
          DOCUMENT ME!
 Field getField()
          DOCUMENT ME!
protected  Object getFieldObject()
          return the object value from the database
protected  String getFieldValue()
          fetches the value from the database. if no value is given, contents of attribute nullFieldValue is returned.
protected  String getFormattedFieldValue()
          fetches the value from the database. if no value is given, contents of attribute nullFieldValue is returned.
protected  Format getFormatter()
          formatting a value
protected  String getFormFieldDefaultValue()
          DOCUMENT ME!
protected  String getFormFieldName()
          generates the decoded name for the html-widget.
protected  String getFormFieldValue()
          Philip Grunikiewicz 2001-05-31 determinates value of the html-widget.
protected  Locale getLocale()
          DOCUMENT ME!
 String getMaxlength()
          Gets the maxlength
 String getName()
          DOCUMENT ME!
protected  String getOverrideFormFieldName()
          DOCUMENT ME!
protected  DbFormTag getParentForm()
          DOCUMENT ME!
 String getPattern()
          DOCUMENT ME!
 String getReadOnlyStyleClass()
          Returns the style class attribute for read-only mode.
 String getStyleClass()
          DOCUMENT ME!
protected  boolean hasOverrideFormFieldNameSet()
          DOCUMENT ME!
 boolean hasReadOnlySet()
          Returns the read-only attribute.
protected  String renderOldValueHtmlInputField()
          writes out the field value in hidden field _old
protected  String renderPatternHtmlInputField()
          writes out the current used format to the page
 void setCustomFormatter(String string)
          DOCUMENT ME!
 void setDefaultValue(String value)
          DOCUMENT ME!
 void setEscaperClass(String string)
          DOCUMENT ME!
protected  void setField(Field field)
          DOCUMENT ME!
 void setFieldName(String fieldName)
          DOCUMENT ME!
 void setMaxlength(String maxlength)
          Sets the maxlength
 void setNullFieldValue(String nullFieldValue)
          Sets the nullFieldValue attribute of the DbLabelTag object
 void setOverrideFormFieldName(String string)
          DOCUMENT ME!
 void setParent(javax.servlet.jsp.tagext.Tag parent)
          DOCUMENT ME!
 void setPattern(String string)
          DOCUMENT ME!
 void setReadOnly(String readOnly)
          Sets the read-only attribute.
 void setReadOnlyStyleClass(String readOnlyStyleClass)
          Sets the style class attribute for read-only mode.
protected  String typicalDefaultValue()
          DOCUMENT ME!
protected  void writeOutSpecialValues()
          writes out all hidden fields for the input fields
 
Methods inherited from class org.dbforms.taglib.TagSupportWithScriptHandler
getAccessKey, getConfig, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getStyle, getTabIndex, getTitle, prepareEventHandlers, prepareStyles, setAccessKey, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setStyle, setStyleClass, setTabIndex, setTitle
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext
 

Constructor Detail

DbBaseHandlerTag

public DbBaseHandlerTag()
Method Detail

setCustomFormatter

public void setCustomFormatter(String string)
DOCUMENT ME!

Parameters:
string -

setDefaultValue

public void setDefaultValue(String value)
DOCUMENT ME!

Parameters:
value - DOCUMENT ME!

getDefaultValue

public String getDefaultValue()
"value" is only used if parent tag is in "insert-mode" (footer, etc.) otherwise this tag takes the current value from the database result!

Returns:
DOCUMENT ME!

getEscaper

public IEscaper getEscaper()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setEscaperClass

public void setEscaperClass(String string)
DOCUMENT ME!

Parameters:
string -

getEscaperClass

public String getEscaperClass()
DOCUMENT ME!

Returns:

getField

public Field getField()
DOCUMENT ME!

Returns:

setFieldName

public void setFieldName(String fieldName)
DOCUMENT ME!

Parameters:
fieldName - DOCUMENT ME!

getFormatter

protected Format getFormatter()
formatting a value

Returns:
DOCUMENT ME!

setMaxlength

public void setMaxlength(String maxlength)
Sets the maxlength

Parameters:
maxlength - The maxlength to set

getMaxlength

public String getMaxlength()
Gets the maxlength

Returns:
Returns a String

getName

public String getName()
DOCUMENT ME!

Returns:

setNullFieldValue

public void setNullFieldValue(String nullFieldValue)
Sets the nullFieldValue attribute of the DbLabelTag object

Parameters:
nullFieldValue - The new nullFieldValue value

setOverrideFormFieldName

public void setOverrideFormFieldName(String string)
DOCUMENT ME!

Parameters:
string -

setParent

public void setParent(javax.servlet.jsp.tagext.Tag parent)
DOCUMENT ME!

Specified by:
setParent in interface javax.servlet.jsp.tagext.Tag
Overrides:
setParent in class javax.servlet.jsp.tagext.TagSupport
Parameters:
parent - DOCUMENT ME!

setPattern

public void setPattern(String string)
DOCUMENT ME!

Parameters:
string -

getPattern

public String getPattern()
DOCUMENT ME!

Returns:

setReadOnly

public void setReadOnly(String readOnly)
Sets the read-only attribute.

Parameters:
readOnly - DOCUMENT ME!

setReadOnlyStyleClass

public void setReadOnlyStyleClass(String readOnlyStyleClass)
Sets the style class attribute for read-only mode.

Parameters:
readOnlyStyleClass - DOCUMENT ME!

getReadOnlyStyleClass

public String getReadOnlyStyleClass()
Returns the style class attribute for read-only mode.

Returns:
DOCUMENT ME!

getStyleClass

public String getStyleClass()
DOCUMENT ME!

Overrides:
getStyleClass in class TagSupportWithScriptHandler
Returns:
DOCUMENT ME!

customFormat

protected String customFormat(String s)
DOCUMENT ME!

Parameters:
s -
Returns:

doFinally

public void doFinally()
DOCUMENT ME!

Overrides:
doFinally in class TagSupportWithScriptHandler
See Also:
TryCatchFinally.doFinally()

hasReadOnlySet

public boolean hasReadOnlySet()
Returns the read-only attribute.

Returns:
DOCUMENT ME!

getCustomFormatter

protected String getCustomFormatter()
DOCUMENT ME!

Returns:

setField

protected void setField(Field field)
DOCUMENT ME!

Parameters:
field - DOCUMENT ME!

getFieldObject

protected Object getFieldObject()
return the object value from the database

Returns:
the object

getFieldValue

protected String getFieldValue()
fetches the value from the database. if no value is given, contents of attribute nullFieldValue is returned.

Returns:
the field value

getFormFieldDefaultValue

protected String getFormFieldDefaultValue()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getFormFieldName

protected String getFormFieldName()
generates the decoded name for the html-widget.

Returns:
DOCUMENT ME!

getFormFieldValue

protected String getFormFieldValue()
Philip Grunikiewicz 2001-05-31 determinates value of the html-widget. In a jsp which contains many input fields, it may be desirable, in the event of an error, to redisplay input data. (instead of refreshing the fields from the DB) Currently dbforms implements this functionality with INSERT fields only. The following describes the changes I've implemented: - I've added a new attribute in the Form tag which sets the functionality (redisplayFieldsOnError=true/false) - I've modified the code below to handle the redisplay of previously posted information

Returns:
DOCUMENT ME!

getFormattedFieldValue

protected String getFormattedFieldValue()
fetches the value from the database. if no value is given, contents of attribute nullFieldValue is returned.

Returns:
the field value

getLocale

protected Locale getLocale()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getOverrideFormFieldName

protected String getOverrideFormFieldName()
DOCUMENT ME!

Returns:

getParentForm

protected DbFormTag getParentForm()
DOCUMENT ME!

Returns:
DOCUMENT ME!

escapeHTML

protected String escapeHTML(String html)
Just a shortcut for calling the escaper

Parameters:
html - string to escape
Returns:
escaped string

hasOverrideFormFieldNameSet

protected boolean hasOverrideFormFieldNameSet()
DOCUMENT ME!

Returns:

renderOldValueHtmlInputField

protected String renderOldValueHtmlInputField()
writes out the field value in hidden field _old

Returns:
DOCUMENT ME!

renderPatternHtmlInputField

protected String renderPatternHtmlInputField()
writes out the current used format to the page

Returns:
DOCUMENT ME!
Throws:
javax.servlet.jsp.JspException

typicalDefaultValue

protected String typicalDefaultValue()
DOCUMENT ME!

Returns:
DOCUMENT ME!

writeOutSpecialValues

protected void writeOutSpecialValues()
                              throws javax.servlet.jsp.JspException
writes out all hidden fields for the input fields

Throws:
javax.servlet.jsp.JspException


Copyright © 2002-2005 DbForms. All Rights Reserved.