com.ora.jsp.tags.xmp
Class ForEachOptionTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.jstl.core.LoopTagSupport
          extended bycom.ora.jsp.tags.xmp.ForEachOptionTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.jstl.core.LoopTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally

public class ForEachOptionTag
extends javax.servlet.jsp.jstl.core.LoopTagSupport

This class is a custom action for creating HTML select lists, checkboxes or radio buttons, where some items need to be marked as selected based on dynamic data. The names and values for the options are provided through a Map, and the selected values are provided as a String[]. The action exposes a bean with three properties to actions in the body, representing the current Map entry:

Version:
2.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Nested Class Summary
 class ForEachOptionTag.OptionBean
           
 
Field Summary
private  java.util.Iterator iterator
           
private  java.util.Map options
           
private  java.lang.String[] selections
           
 
Fields inherited from class javax.servlet.jsp.jstl.core.LoopTagSupport
begin, beginSpecified, end, endSpecified, itemId, statusId, step, stepSpecified
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Constructor Summary
ForEachOptionTag()
           
 
Method Summary
protected  boolean hasNext()
           
private  boolean isSelected(java.lang.String value)
           
protected  java.lang.Object next()
           
protected  void prepare()
           
 void setOptions(java.util.Map options)
           
 void setSelections(java.lang.String[] selections)
           
 
Methods inherited from class javax.servlet.jsp.jstl.core.LoopTagSupport
doAfterBody, doCatch, doFinally, doStartTag, getCurrent, getLoopStatus, release, setVar, setVarStatus, validateBegin, validateEnd, validateStep
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, 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
doEndTag, getParent, setPageContext, setParent
 

Field Detail

options

private java.util.Map options

selections

private java.lang.String[] selections

iterator

private java.util.Iterator iterator
Constructor Detail

ForEachOptionTag

public ForEachOptionTag()
Method Detail

setOptions

public void setOptions(java.util.Map options)

setSelections

public void setSelections(java.lang.String[] selections)

prepare

protected void prepare()

next

protected java.lang.Object next()

hasNext

protected boolean hasNext()

isSelected

private boolean isSelected(java.lang.String value)