@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WRadioButtonSelect rbSelect = (WRadioButtonSelect) component;
		XmlStringBuilder xml = renderContext.getWriter();
		int cols = rbSelect.getButtonColumns();
		boolean readOnly = rbSelect.isReadOnly();

		xml.appendTagOpen("ui:radiobuttonselect");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", rbSelect.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			xml.appendOptionalAttribute("disabled", rbSelect.isDisabled(), "true");
			xml.appendOptionalAttribute("required", rbSelect.isMandatory(), "true");
			xml.appendOptionalAttribute("submitOnChange", rbSelect.isSubmitOnChange(), "true");
			xml.appendOptionalAttribute("toolTip", component.getToolTip());
			xml.appendOptionalAttribute("accessibleText", component.getAccessibleText());
		}
		xml.appendOptionalAttribute("frameless", rbSelect.isFrameless(), "true");

		switch (rbSelect.getButtonLayout()) {
			case COLUMNS:
				xml.appendAttribute("layout", "column");
				xml.appendOptionalAttribute("layoutColumnCount", cols > 0, String.valueOf(cols));
				break;
			case FLAT:
				xml.appendAttribute("layout", "flat");
				break;
			case STACKED:
				xml.appendAttribute("layout", "stacked");
				break;
			default:
				throw new SystemException("Unknown radio button layout: " + rbSelect.getButtonLayout());
		}

		xml.appendClose();

		// Options
		List<?> options = rbSelect.getOptions();
		boolean renderSelectionsOnly = readOnly;

		if (options != null) {
			int optionIndex = 0;
			Object selectedOption = rbSelect.getSelected();

			for (Object option : options) {
				if (option instanceof OptionGroup) {
					throw new SystemException("Option groups not supported in WRadioButtonSelect.");
				} else {
					renderOption(rbSelect, option, optionIndex++, xml, selectedOption, renderSelectionsOnly);
				}
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(rbSelect, renderContext);
		}
		xml.appendEndTag("ui:radiobuttonselect");

		if (rbSelect.isAjax()) {
			paintAjax(rbSelect, xml);
		}
	}
@ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { WRadioButtonSelect rbSelect = ( WRadioButtonSelect ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; int cols = rbSelect . getButtonColumns ( ) ; boolean readOnly = rbSelect . isReadOnly ( ) ; xml . appendTagOpen ( "ui:radiobuttonselect" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component . isTracking ( ) , "true" ) ; xml . appendOptionalAttribute ( "hidden" , rbSelect . isHidden ( ) , "true" ) ; if ( readOnly ) { xml . appendAttribute ( "readOnly" , "true" ) ; } else { xml . appendOptionalAttribute ( "disabled" , rbSelect . isDisabled ( ) , "true" ) ; xml . appendOptionalAttribute ( "required" , rbSelect . isMandatory ( ) , "true" ) ; xml . appendOptionalAttribute ( "submitOnChange" , rbSelect . isSubmitOnChange ( ) , "true" ) ; xml . appendOptionalAttribute ( "toolTip" , component . getToolTip ( ) ) ; xml . appendOptionalAttribute ( "accessibleText" , component . getAccessibleText ( ) ) ; } xml . appendOptionalAttribute ( "frameless" , rbSelect . isFrameless ( ) , "true" ) ; switch ( rbSelect . getButtonLayout ( ) ) { case COLUMNS : xml . appendAttribute ( "layout" , "column" ) ; xml . appendOptionalAttribute ( "layoutColumnCount" , cols > 0 , String . valueOf ( cols ) ) ; break ; case FLAT : xml . appendAttribute ( "layout" , "flat" ) ; break ; case STACKED : xml . appendAttribute ( "layout" , "stacked" ) ; break ; default : throw new SystemException ( "Unknown radio button layout: " + rbSelect . getButtonLayout ( ) ) ; } xml . appendClose ( ) ; List < ? > options = rbSelect . getOptions ( ) ; boolean renderSelectionsOnly = readOnly ; if ( options != null ) { int optionIndex = 0 ; Object selectedOption = rbSelect . getSelected ( ) ; for ( Object option : options ) { if ( option instanceof OptionGroup ) { throw new SystemException ( "Option groups not supported in WRadioButtonSelect." ) ; } else { renderOption ( rbSelect , option , optionIndex ++ , xml , selectedOption , renderSelectionsOnly ) ; } } } if ( ! readOnly ) { DiagnosticRenderUtil . renderDiagnostics ( rbSelect , renderContext ) ; } xml . appendEndTag ( "ui:radiobuttonselect" ) ; if ( rbSelect . isAjax ( ) ) { paintAjax ( rbSelect , xml ) ; } }
Paints the given WRadioButtonSelect.

@param component the WRadioButtonSelect to paint.
@param renderContext the RenderContext to paint to.