@ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { WMultiSelectPair multiSelectPair = ( WMultiSelectPair ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; boolean readOnly = multiSelectPair . isReadOnly ( ) ; xml . appendTagOpen ( "ui:multiselectpair" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component . isTracking ( ) , "true" ) ; xml . appendOptionalAttribute ( "hidden" , multiSelectPair . isHidden ( ) , "true" ) ; if ( readOnly ) { xml . appendAttribute ( "readOnly" , "true" ) ; } else { int rows = multiSelectPair . getRows ( ) ; int min = multiSelectPair . getMinSelect ( ) ; int max = multiSelectPair . getMaxSelect ( ) ; xml . appendAttribute ( "size" , rows < 2 ? WMultiSelectPair . DEFAULT_ROWS : rows ) ; xml . appendOptionalAttribute ( "disabled" , multiSelectPair . isDisabled ( ) , "true" ) ; xml . appendOptionalAttribute ( "required" , multiSelectPair . isMandatory ( ) , "true" ) ; xml . appendOptionalAttribute ( "shuffle" , multiSelectPair . isShuffle ( ) , "true" ) ; xml . appendOptionalAttribute ( "fromListName" , multiSelectPair . getAvailableListName ( ) ) ; xml . appendOptionalAttribute ( "toListName" , multiSelectPair . getSelectedListName ( ) ) ; xml . appendOptionalAttribute ( "accessibleText" , multiSelectPair . getAccessibleText ( ) ) ; xml . appendOptionalAttribute ( "min" , min > 0 , min ) ; xml . appendOptionalAttribute ( "max" , max > 0 , max ) ; } xml . appendClose ( ) ; // Options List < ? > options = multiSelectPair . getOptions ( ) ; boolean renderSelectionsOnly = readOnly ; if ( options != null ) { if ( multiSelectPair . isShuffle ( ) ) { // We need to render the selected options in order renderOrderedOptions ( multiSelectPair , options , 0 , xml , renderSelectionsOnly ) ; } else { renderUnorderedOptions ( multiSelectPair , options , 0 , xml , renderSelectionsOnly ) ; } } if ( ! readOnly ) { DiagnosticRenderUtil . renderDiagnostics ( multiSelectPair , renderContext ) ; } xml . appendEndTag ( "ui:multiselectpair" ) ; }
Paints the given WMultiSelectPair .