public int doEndTag() throws JspException
    {
        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        // we verified that the parent was a CheckboxGroup in the doBeginTag()
        ServletRequest req = pageContext.getRequest();
        CheckBoxGroup parent = (CheckBoxGroup) findAncestorWithClass(this, CheckBoxGroup.class);
        ConstantRendering cr = TagRenderingBase.Factory.getConstantRendering(req);
        boolean repeat = parent.isRepeater();

        // create the writer
        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        if (!repeat && parent.isVertical()) {
            cr.TR_TD(writer);
        }


        _state.type = INPUT_CHECKBOX;
        _state.name = parent.getQualifiedDataSourceName();
        if (_state.id != null) {
            String tagId = _state.id;
            _state.id = getIdForTagId(_state.id);
            /* This has been commented out because we can't set focus on checkbox options
               because they don't have a unique name.
            Form parentForm = getNearestForm();
            if (parentForm != null)
                parentForm.addTagID(tagId, _state.name);
                */
            String script = renderDefaultNameAndId((HttpServletRequest) req, _state, tagId, _state.name);
            if (script != null) {
                write(script);
            }
        }

        // Disabled on the option itself will override the parent setting this.
        // We check to see if the option actuall had disabled set on it, if not then look
        // at the parent.
        if (parent.isMatched(_state.value, _defaultValue))
            _state.checked = true;
        _state.disabled = isDisabled();
        if (!_state.disabled)
            _state.disabled = parent.isDisabled();

        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req);
        br.doStartTag(writer, _state);
        br.doEndTag(writer);

        if (repeat && !parent.isDisabled()) {
            parent.createHiddenField(writer);
        }

        // if this is in a repeater, then we only output the <input tag>
        if (repeat) {
            //write(results.toString());
            localRelease();
            return EVAL_PAGE;
        }

        if (_spanState.style == null) {
            _spanState.style = parent.getLabelStyle();
        }
        if (_spanState.styleClass == null) {
            _spanState.styleClass = parent.getLabelStyleClass();
        }

        TagRenderingBase spanTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.SPAN_TAG, req);
        spanTag.doStartTag(writer, _spanState);
        if (_text == null)
            write(_state.value);
        else
            write(_text);
        spanTag.doEndTag(writer);

        if (parent.isVertical()) {
            cr.end_TD_TR(writer);
        }

        // Continue evaluating this page
        localRelease();
        return EVAL_PAGE;

    }
public int doEndTag ( ) throws JspException { if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; ServletRequest req = pageContext . getRequest ( ) ; CheckBoxGroup parent = ( CheckBoxGroup ) findAncestorWithClass ( this , CheckBoxGroup . class ) ; ConstantRendering cr = TagRenderingBase . Factory . getConstantRendering ( req ) ; boolean repeat = parent . isRepeater ( ) ; WriteRenderAppender writer = new WriteRenderAppender ( pageContext ) ; if ( ! repeat && parent . isVertical ( ) ) { cr . TR_TD ( writer ) ; } _state . type = INPUT_CHECKBOX ; _state . name = parent . getQualifiedDataSourceName ( ) ; if ( _state . id != null ) { String tagId = _state . id ; _state . id = getIdForTagId ( _state . id ) ; String script = renderDefaultNameAndId ( ( HttpServletRequest ) req , _state , tagId , _state . name ) ; if ( script != null ) { write ( script ) ; } } if ( parent . isMatched ( _state . value , _defaultValue ) ) _state . checked = true ; _state . disabled = isDisabled ( ) ; if ( ! _state . disabled ) _state . disabled = parent . isDisabled ( ) ; TagRenderingBase br = TagRenderingBase . Factory . getRendering ( TagRenderingBase . INPUT_BOOLEAN_TAG , req ) ; br . doStartTag ( writer , _state ) ; br . doEndTag ( writer ) ; if ( repeat && ! parent . isDisabled ( ) ) { parent . createHiddenField ( writer ) ; } if ( repeat ) { localRelease ( ) ; return EVAL_PAGE ; } if ( _spanState . style == null ) { _spanState . style = parent . getLabelStyle ( ) ; } if ( _spanState . styleClass == null ) { _spanState . styleClass = parent . getLabelStyleClass ( ) ; } TagRenderingBase spanTag = TagRenderingBase . Factory . getRendering ( TagRenderingBase . SPAN_TAG , req ) ; spanTag . doStartTag ( writer , _spanState ) ; if ( _text == null ) write ( _state . value ) ; else write ( _text ) ; spanTag . doEndTag ( writer ) ; if ( parent . isVertical ( ) ) { cr . end_TD_TR ( writer ) ; } localRelease ( ) ; return EVAL_PAGE ; }
Process the end of this tag.
@throws JspException if a JSP exception has occurred