@ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { WSelectToggle toggle = ( WSelectToggle ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; xml . appendTagOpen ( "ui:selecttoggle" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component . isTracking ( ) , "true" ) ; State state = toggle . getState ( ) ; if ( State . ALL . equals ( state ) ) { xml . appendAttribute ( "selected" , "all" ) ; } else if ( State . NONE . equals ( state ) ) { xml . appendAttribute ( "selected" , "none" ) ; } else { xml . appendAttribute ( "selected" , "some" ) ; } xml . appendOptionalAttribute ( "disabled" , toggle . isDisabled ( ) , "true" ) ; xml . appendAttribute ( "target" , toggle . getTarget ( ) . getId ( ) ) ; xml . appendAttribute ( "renderAs" , toggle . isRenderAsText ( ) ? "text" : "control" ) ; xml . appendOptionalAttribute ( "roundTrip" , ! toggle . isClientSide ( ) , "true" ) ; xml . appendEnd ( ) ; }
Paints the given WSelectToggle .