public int doEndTag ( ) throws JspException { if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; String idScript = null ; String altText = null ; char accessKey = 0x00 ; // Remove the page scope attributes we created pageContext . removeAttribute ( RADIOBUTTONGROUP_KEY ) ; ServletRequest req = pageContext . getRequest ( ) ; if ( _cr == null ) _cr = TagRenderingBase . Factory . getConstantRendering ( req ) ; //InternalStringBuilder results = new InternalStringBuilder(128); if ( _saveBody != null ) write ( _saveBody . toString ( ) ) ; // if this is a repeater we output the content during the body processing if ( _repeater ) { // Render a tag representing the end of our current form if ( isVertical ( ) ) _cr . end_TABLE ( _writer ) ; if ( idScript != null ) write ( idScript ) ; //write(results.toString()); localRelease ( ) ; return EVAL_PAGE ; } // Render a tag representing the end of our current form if ( _dynamicAttrs instanceof Map ) { Map dynamicRadiosMap = ( Map ) _dynamicAttrs ; Iterator keyIterator = dynamicRadiosMap . keySet ( ) . iterator ( ) ; int idx = 0 ; while ( keyIterator . hasNext ( ) ) { Object optionValue = keyIterator . next ( ) ; String optionDisplay = null ; if ( dynamicRadiosMap . get ( optionValue ) != null ) { optionDisplay = dynamicRadiosMap . get ( optionValue ) . toString ( ) ; } else { optionDisplay = "" ; } if ( optionValue != null ) { addOption ( _writer , INPUT_RADIO , optionValue . toString ( ) , optionDisplay , idx ++ , altText , accessKey , _disabled ) ; } if ( hasErrors ( ) ) { reportErrors ( ) ; localRelease ( ) ; return EVAL_PAGE ; } write ( "\n" ) ; } } else { assert ( _dynamicAttrs instanceof Iterator ) ; Iterator it = ( Iterator ) _dynamicAttrs ; int idx = 0 ; while ( it . hasNext ( ) ) { Object o = it . next ( ) ; if ( o == null ) continue ; if ( o instanceof GroupOption ) { GroupOption go = ( GroupOption ) o ; addOption ( _writer , INPUT_RADIO , go . getValue ( ) , go . getName ( ) , idx ++ , go . getAlt ( ) , go . getAccessKey ( ) , _disabled ) ; } else { String radioValue = o . toString ( ) ; addOption ( _writer , INPUT_RADIO , radioValue , radioValue , idx ++ , altText , accessKey , _disabled ) ; } if ( hasErrors ( ) ) { reportErrors ( ) ; localRelease ( ) ; return EVAL_PAGE ; } write ( "\n" ) ; } } if ( isVertical ( ) ) { _cr . end_TABLE ( _writer ) ; } if ( idScript != null ) write ( idScript ) ; //write(results.toString()); localRelease ( ) ; return EVAL_PAGE ; }
Render the set of RadioButtonOptions .