com.taggercat.tags
Class BooleanOptionListTag

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

public class BooleanOptionListTag
extends javax.servlet.jsp.tagext.TagSupport

This tag creates an option list for the specified dsn.field.

The option list defaults to Yes/No and the fields current value is set as the selected value.

You can optionally specify your own values for the display and stored values.

 

example: <select name="<tc:dataFieldUID dsn='Account' field='Status' />"> <tc:booleanOptionList dsn="Account" field="Status" /> </select>

example: <tc:booleanOptionList dsn="Account" field="Status" displayValues="Open,Closed"/>

example: <tc:booleanOptionList dsn="Account" field="Status" displayValues="New,Old"/>

example: <tc:booleanOptionList dsn="Account" field="Status" displayValues="Pending,Closed,Open" codeValues=",false,true" states="null,false,true" />

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
BooleanOptionListTag()
          Create a new tag instance.
 
Method Summary
 int doEndTag()
          Resets the tags internal state.
 int doStartTag()
          Create the option list tags.
 java.lang.String getDsn()
          Gets the data source name.
 java.lang.String getField()
          Gets the field name .
 void setCodeValues(java.lang.String codes)
          Sets the possible code ( stored ) values in the option list.
 void setDisplayValues(java.lang.String values)
          Sets the possible choices in the option list.
 void setDsn(java.lang.String dsn)
          Set the name of the data source this field to test as a boolean ( optional ).
 void setField(java.lang.String field)
          Sets the field name attribute ( optional ).
 void setStates(java.lang.String states)
          Sets the possible "states" in the option list.
 
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

BooleanOptionListTag

public BooleanOptionListTag()
Create a new tag instance.

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 javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException
Returns:
EVAL_PAGE

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Create the option list tags.

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

getDsn

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

Returns:
the data source name

getField

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

Returns:
the field name

setCodeValues

public void setCodeValues(java.lang.String codes)
Sets the possible code ( stored ) values in the option list. Specifically, these are the values used to set the property's value. There must be at least two of "true,false" in a comma separated list, and in the same order as the "display" and "code" values.

Parameters:
codes - the supported code values

setDisplayValues

public void setDisplayValues(java.lang.String values)
Sets the possible choices in the option list. They must be in a comma separated list. If listing only true/false values, they must be listed in true/false order. If listing more than two value, or you are also list code & state values, they must all be listed in the same order.

Parameters:
values - the supported choice values

setDsn

public void setDsn(java.lang.String dsn)
Set the name of the data source this field to test as a boolean ( optional ).

Parameters:
dsn - the new dsn fieldValue

setField

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

Parameters:
field - the new field fieldValue

setStates

public void setStates(java.lang.String states)
Sets the possible "states" in the option list. There must be at least two of "true, false, and null" in a comma separated list, and in the same order as the "display" and "code" values.

Parameters:
states - the supported states