public int doStartTag ( ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; if ( _cr == null ) _cr = TagRenderingBase . Factory . getConstantRendering ( req ) ; // get the evaluated dataSource and default values Object val = evaluateDataSource ( ) ; _defaultSelections = ( List ) evaluateDefaultValue ( ) ; if ( hasErrors ( ) ) { return SKIP_BODY ; } // process the default values and create the matching array... if ( val != null ) { buildMatch ( val ) ; if ( hasErrors ( ) ) { return SKIP_BODY ; } } // if the checkbox group is disabled do not write out the // hidden field. _writer = new WriteRenderAppender ( pageContext ) ; if ( ! _repeater && ! _disabled ) { //Create hidden field for state tracking _state . clear ( ) ; String hiddenParamName = null ; hiddenParamName = getQualifiedDataSourceName ( ) + OLDVALUE_SUFFIX ; _state . name = hiddenParamName ; _state . value = "true" ; TagRenderingBase hiddenTag = TagRenderingBase . Factory . getRendering ( TagRenderingBase . INPUT_HIDDEN_TAG , req ) ; hiddenTag . doStartTag ( _writer , _state ) ; hiddenTag . doEndTag ( _writer ) ; } if ( isVertical ( ) ) _cr . TABLE ( _writer ) ; // if this is a repeater then we shouid prime the pump... _dynamicAttrs = evaluateOptionsDataSource ( ) ; assert ( _dynamicAttrs != null ) ; assert ( _dynamicAttrs instanceof Map || _dynamicAttrs instanceof Iterator ) ; if ( _repeater ) { if ( _dynamicAttrs instanceof Map ) { _dynamicAttrs = ( ( Map ) _dynamicAttrs ) . entrySet ( ) . iterator ( ) ; } if ( ! ( _dynamicAttrs instanceof Iterator ) ) { String s = Bundle . getString ( "Tags_OptionsDSIteratorError" ) ; registerTagError ( s , null ) ; return SKIP_BODY ; } while ( ( ( Iterator ) _dynamicAttrs ) . hasNext ( ) ) { _repCurItem = ( ( Iterator ) _dynamicAttrs ) . next ( ) ; if ( _repCurItem != null ) break ; } if ( isVertical ( ) ) _cr . TR_TD ( _writer ) ; DataAccessProviderStack . addDataAccessProvider ( this , pageContext ) ; } _saveBody = new InternalStringBuilder ( 128 ) ; // Continue processing this page return EVAL_BODY_BUFFERED ; }
Determine the set of matches for the CheckBoxGroup