org.opensubsystems.patterns.dialoglayout.www
Class DynamicListTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.opensubsystems.core.www.PageElementCacheTag
              extended by org.opensubsystems.core.www.BlockElementTag
                  extended by org.opensubsystems.patterns.dialoglayout.www.DynamicListTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class DynamicListTag
extends org.opensubsystems.core.www.BlockElementTag

Custom tag to generate all HTML code necessary to display dynamic list control that allows to type an item and then add it to the list, edit the items already in the list and reorder the items in the list. This means that in the 1st row it will display the following controls: edit field + optional checkbox + Add button Below it will be displayed multiselect list with buttons Remove, Up, Down It looks as following: [ ] [ Add ] Added items: [ ] [ Remove ] | | [ Up ] [ ] [ Down ] Advanced dynamic list with checkbox looks as following: [ ] FlagDesc: [X] [ Add ] Added items: [ ] [ Remove ] | | [ Up ] [ ] [ Down ] The initial content of the list will be specified in the page using standard options tags. The values of the option tags can contain optional id that is different from the displayed text and an optional order number of the item. If the id and order number are specified, they must be specified in the value parameter of the options tag in the following format: id:order.

Version:
$Id: DynamicListTag.java,v 1.19 2007/02/01 07:23:08 bastafidli Exp $
Author:
Julian Legeny
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.12 2006/05/01 23:42:38 jlegeny

Field Summary
static java.lang.String CHECK_INDICATOR_ID
          ID for check indicator flag.
static java.lang.String DEFAULT_CHECK_INDICATOR
          Default char indicator if checkbox is checked.
protected  java.lang.String m_strBufferName
          Name of the input hidden parameter that stores data to submit to the server.
protected  java.lang.String m_strChangedName
          Name of the input hidden parameter that stores data to submit to the server.
protected  java.lang.String m_strCheck
          Flag specifying if there will be checkbox following the edit field control in the first row.
protected  java.lang.String m_strCheckIdentifier
          String that will appended to the string in the edit field if the checkbox was checked when the Add button was pressed.
protected  java.lang.String m_strCheckLabel
          Label displayed in front of the checkbox control in the first row.
protected  java.lang.String m_strDisabled
          Flag which will tells us if the buttons are disabled.
protected  java.lang.String m_strFocus
          Does this control have focus when it is displayed on the page or not.
protected  java.lang.String m_strListLabel
          Label displayed above the list of existing (added) items.
protected  java.lang.String m_strRemovedName
          Name of the input hidden parameter that stores data to submit to the server.
protected  java.lang.String m_strSize
          Size of the select list.
 
Fields inherited from class org.opensubsystems.core.www.BlockElementTag
CURRENT_ELEMENT_ID, DIV_BLOCK_ELEMENT, m_strCssclass, m_strIdSuffix, m_strRelatedIds, m_strStyle, m_strType, SPAN_BLOCK_ELEMENT
 
Fields inherited from class org.opensubsystems.core.www.PageElementCacheTag
CACHE_INDICATOR, CSS_ELEMENT, JS_ELEMENT, m_strCacheas, m_strId, PAGE_ELEMENTS_CACHE, SCRIPT_ELEMENT
 
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
DynamicListTag()
          Constructor for custom tag.
 
Method Summary
 int doEndTag()
          
 int doStartTag()
          
 java.lang.String getBuffername()
           
 java.lang.String getChangedname()
           
 java.lang.String getCheck()
           
 java.lang.String getCheckidentifier()
           
 java.lang.String getChecklabel()
           
 java.lang.String getDisabled()
           
 java.lang.String getFocus()
           
 java.lang.String getListlabel()
           
 java.lang.String getRemovedname()
           
 java.lang.String getSize()
           
 boolean isCheckboxUsed()
           
 boolean isDisabledControl()
           
 boolean isFocusedControl()
           
 void setBuffername(java.lang.String strBufferName)
           
 void setChangedname(java.lang.String strChangedName)
           
 void setCheck(boolean bCheck)
           
 void setCheck(java.lang.String strCheck)
           
 void setCheckidentifier(java.lang.String strCheckIdentifier)
           
 void setChecklabel(java.lang.String strCheckLabel)
           
 void setDisabled(boolean bDisabled)
           
 void setDisabled(java.lang.String strDisabled)
           
 void setFocus(boolean bFocus)
           
 void setFocus(java.lang.String strFocus)
           
 void setListlabel(java.lang.String strListLabel)
           
 void setRemovedname(java.lang.String strRemovedName)
           
 void setSize(java.lang.String strSize)
           
 
Methods inherited from class org.opensubsystems.core.www.BlockElementTag
adjustId, getCssclass, getCurrentId, getRelatedids, getStyle, getType, isRelatedIdsTag, popCurrentId, pushCurrentId, restoreId, setCssclass, setRelatedids, setRelatedids, setStoredId, setStyle, setType
 
Methods inherited from class org.opensubsystems.core.www.PageElementCacheTag
cache, getCacheas, getCachedContent, getCachedContent, getCachedContent, getCachedContentElements, getId, setCacheas, setId
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, 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
getParent, setPageContext, setParent
 

Field Detail

DEFAULT_CHECK_INDICATOR

public static final java.lang.String DEFAULT_CHECK_INDICATOR
Default char indicator if checkbox is checked.

See Also:
Constant Field Values

CHECK_INDICATOR_ID

public static final java.lang.String CHECK_INDICATOR_ID
ID for check indicator flag.

See Also:
Constant Field Values

m_strFocus

protected java.lang.String m_strFocus
Does this control have focus when it is displayed on the page or not. Only one control on a page or tab can be marked as focus at a time. If multiple controls are marked this way, then the first one on the page or tab will get the focus.


m_strDisabled

protected java.lang.String m_strDisabled
Flag which will tells us if the buttons are disabled.


m_strSize

protected java.lang.String m_strSize
Size of the select list.


m_strCheck

protected java.lang.String m_strCheck
Flag specifying if there will be checkbox following the edit field control in the first row.


m_strCheckLabel

protected java.lang.String m_strCheckLabel
Label displayed in front of the checkbox control in the first row.


m_strCheckIdentifier

protected java.lang.String m_strCheckIdentifier
String that will appended to the string in the edit field if the checkbox was checked when the Add button was pressed. This identifier will be visible within the multi select control below as part of the added item.


m_strListLabel

protected java.lang.String m_strListLabel
Label displayed above the list of existing (added) items.


m_strBufferName

protected java.lang.String m_strBufferName
Name of the input hidden parameter that stores data to submit to the server. The variable will be populated by the custom tag and will contain all data the control contains when the form is submitted to the server. The data are have following format: item_id_1;order_number_1:encode(item_text_1)#...#item_id_N;order_number_N:encode(item_text_N)


m_strRemovedName

protected java.lang.String m_strRemovedName
Name of the input hidden parameter that stores data to submit to the server. It contains ????? TODO: For Julo: What does the input with this variable contains? Once you fix this, update the description in tld as well. TODO: For Julo: This is never used on any page or in the test. How do you know it works?


m_strChangedName

protected java.lang.String m_strChangedName
Name of the input hidden parameter that stores data to submit to the server. It contains ????? TODO: For Julo: What does the input with this variable contains? Once you fix this, update the description in tld as well. TODO: For Julo: This is never used on any page or in the test. How do you know it works?

Constructor Detail

DynamicListTag

public DynamicListTag()
Constructor for custom tag.

Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class org.opensubsystems.core.www.BlockElementTag
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class org.opensubsystems.core.www.BlockElementTag
Throws:
javax.servlet.jsp.JspException

getFocus

public java.lang.String getFocus()
Returns:
String - Does this control have focus when it si displayed on the page or not.

setFocus

public void setFocus(java.lang.String strFocus)
Parameters:
strFocus - - If this control have focus when it si displayed on the page say true or 1.

setFocus

public void setFocus(boolean bFocus)
Parameters:
bFocus - - Does this control have focus when it si displayed on the page or tab.

isFocusedControl

public boolean isFocusedControl()
Returns:
boolean - true if this control has focus when it is displayed on a page or tab

getDisabled

public java.lang.String getDisabled()
Returns:
String - If this control should be disabled then this attribute should say true or 1.

setDisabled

public void setDisabled(java.lang.String strDisabled)
Parameters:
strDisabled - - If this control should be disabled then this attribute should say true or 1.

setDisabled

public void setDisabled(boolean bDisabled)
Parameters:
bDisabled - - If this control should be disabled then this attribute should say true or 1.

isDisabledControl

public boolean isDisabledControl()
Returns:
boolean - true if this control should be disabled

getSize

public java.lang.String getSize()
Returns:
String - Size of the control

setSize

public void setSize(java.lang.String strSize)
Parameters:
strSize - - Size of the control

getCheck

public java.lang.String getCheck()
Returns:
String - If this control should shown checkbox then this attribute should say true or 1.

setCheck

public void setCheck(java.lang.String strCheck)
Parameters:
strCheck - - If this control should shown checkbox then this attribute should say true or 1.

setCheck

public void setCheck(boolean bCheck)
Parameters:
bCheck - - If this control should shown checkbox then this attribute should say true or 1.

isCheckboxUsed

public boolean isCheckboxUsed()
Returns:
boolean - true if there will be shown checkbox in the 1st rox

getChecklabel

public java.lang.String getChecklabel()
Returns:
String - label related to the checkbox

setChecklabel

public void setChecklabel(java.lang.String strCheckLabel)
Parameters:
strCheckLabel - - label related to the checkbox

getCheckidentifier

public java.lang.String getCheckidentifier()
Returns:
String - string identifying if the checkbox was checked

setCheckidentifier

public void setCheckidentifier(java.lang.String strCheckIdentifier)
Parameters:
strCheckIdentifier - - string identifying if the checkbox was checked multi select control bellow.

getListlabel

public java.lang.String getListlabel()
Returns:
String - label related to the list of added items

setListlabel

public void setListlabel(java.lang.String strListLabel)
Parameters:
strListLabel - - label related to the list of added items

getBuffername

public java.lang.String getBuffername()
Returns:
String - name of the input hidden parameter that stores data for submit

setBuffername

public void setBuffername(java.lang.String strBufferName)
Parameters:
strBufferName - - name of the input hidden parameter that stores data to submit to the server

getRemovedname

public java.lang.String getRemovedname()
Returns:
String - name of the input hidden parameter that stores data for submit

setRemovedname

public void setRemovedname(java.lang.String strRemovedName)
Parameters:
strRemovedName - - name of the input hidden parameter that stores data to submit to the server

getChangedname

public java.lang.String getChangedname()
Returns:
String - name of the input hidden parameter that stores data for submit

setChangedname

public void setChangedname(java.lang.String strChangedName)
Parameters:
strChangedName - - name of the input hidden parameter that stores data to submit to the server


Copyright © 2003 - 2006 OpenSubsystems s.r.o.