com.taggercat.tags
Class HQLOptionListTag

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

public class HQLOptionListTag
extends AbstractExpEvalTag

This tag creates an option list that is filled directly from an HQL query rather than from a Datasource or code table.

The HQL query must return are least two columns, and the first column must be the code value. Where the code value is usually the PK. The second column is used for the display value.

If the HQL returns three columns, then the third one is used for the title attribute.

Like the other option list tags, this one will attempt to automatically selected the correct option based upon this tag's context.

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
HQLOptionListTag()
           
 
Method Summary
 int doEndTag()
          Resets the tags internal state.
 int doStartTag()
          Creates and the option list tags and sends them to the page.
 java.lang.String getCacheRegion()
           
 java.lang.String getFilter()
          Gets the filter expression string.
 java.lang.String getHql()
           
 java.lang.String getSelected()
          Gets the selected item.
 java.lang.String getSelectedFK()
          Gets the selectedFK attribute.
 java.lang.String getSelectedStyleclass()
          Gets the CSS style class to be used to selected items in the option list.
 java.lang.String getStyleclass()
          Gets the CSS style class to be used to items in the option list.
 boolean isCachable()
           
 void setCachable(boolean cachable)
           
 void setCacheRegion(java.lang.String cacheRegion)
           
 void setCondition(java.lang.String expression)
          Sets the condition filter to be applied to source data source.
 void setEmptyItem(boolean emptyItem)
          Set to true to add an empty item to the option list.
 void setHql(java.lang.String hql)
           
 void setSelected(java.lang.String selected)
          Sets the selected attribute.
 void setSelectedFK(java.lang.String selectedFK)
          Sets the selectedFK attribute.
 void setSelectedStyleclass(java.lang.String selectedStyleclass)
          Sets the CSS style class to be used to selected items in the option list.
 void setStyleclass(java.lang.String styleclass)
          Sets the CSS style class to be used to items in the option list.
 void setTitleProperty(java.lang.String titleProperty)
           
 
Methods inherited from class com.taggercat.tags.AbstractExpEvalTag
getModel, resolveProperty, setScope, setValue, setVar
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HQLOptionListTag

public HQLOptionListTag()
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 AbstractExpEvalTag
Throws:
javax.servlet.jsp.JspException
Returns:
EVAL_PAGE

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Creates and the option list tags and sends them to the page.

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

getHql

public java.lang.String getHql()
Returns:
the hql

setHql

public void setHql(java.lang.String hql)
Parameters:
hql - the hql to set

getCacheRegion

public java.lang.String getCacheRegion()
Returns:
the cacheRegion

setCacheRegion

public void setCacheRegion(java.lang.String cacheRegion)
Parameters:
cacheRegion - the cacheRegion to set

isCachable

public boolean isCachable()
Returns:
the cachable

setCachable

public void setCachable(boolean cachable)
Parameters:
cachable - the cachable to set

getFilter

public java.lang.String getFilter()
Gets the filter expression string.

Returns:
the filter expression

getSelected

public java.lang.String getSelected()
Gets the selected item.

Returns:
the selected item

getSelectedFK

public java.lang.String getSelectedFK()
Gets the selectedFK attribute.

Returns:
the selectedFK

getSelectedStyleclass

public java.lang.String getSelectedStyleclass()
Gets the CSS style class to be used to selected items in the option list.

Returns:
the CSS style class to be used to selected items in the option list.

getStyleclass

public java.lang.String getStyleclass()
Gets the CSS style class to be used to items in the option list.

Returns:
the CSS style class to be used to items in the option list

setEmptyItem

public void setEmptyItem(boolean emptyItem)
Set to true to add an empty item to the option list.

Parameters:
emptyItem - The new codeField value

setCondition

public void setCondition(java.lang.String expression)
Sets the condition filter to be applied to source data source.

If a condition filter is not specified, then all rows from the source data source will be included in the option list.

Parameters:
expression - The filter expression

setSelected

public void setSelected(java.lang.String selected)
Sets the selected attribute. This is a value that is used to match one of the code field in one of the rows of the source DSN.

If a selected value is not specified, then the selected tcEntity is matched using the selectedFK DSN & Field.

Parameters:
selected - The new selected value

setSelectedFK

public void setSelectedFK(java.lang.String selectedFK)
Sets the selectedFK attribute. This is a dot delimited name of the form DSN.FIELD. Where DSN is the name of a child table, and FIELD is the name of the of foreign key column in the child table. The selected attribute, and the selectedFK attributes are mutually exclusive.

If this value is specified, then the item selected in the list will be the one matching the foreign key value from the current tcEntity in the child table.

Parameters:
selectedFK - The selectedFK value

setSelectedStyleclass

public void setSelectedStyleclass(java.lang.String selectedStyleclass)
Sets the CSS style class to be used to selected items in the option list.

Parameters:
selectedStyleclass - the CSS style class to be used to selected items in the option list.

setStyleclass

public void setStyleclass(java.lang.String styleclass)
Sets the CSS style class to be used to items in the option list.

Parameters:
styleclass - the CSS style class to be used to items in the option list

setTitleProperty

public void setTitleProperty(java.lang.String titleProperty)