private static void encodeTabAnchorTag ( FacesContext context , ResponseWriter writer , Tab tab , String hiddenInputFieldID , int tabindex , boolean disabled ) throws IOException { writer . startElement ( "a" , tab ) ; writer . writeAttribute ( "id" , tab . getClientId ( ) . replace ( ":" , "_" ) + "_tab" , "id" ) ; writer . writeAttribute ( "role" , "tab" , "role" ) ; if ( tab . isDisabled ( ) || disabled ) { writer . writeAttribute ( "onclick" , "event.preventDefault(); return false;" , null ) ; } else { writer . writeAttribute ( "data-toggle" , "tab" , "data-toggle" ) ; writer . writeAttribute ( "href" , "#" + tab . getClientId ( ) . replace ( ":" , "_" ) + "_pane" , "href" ) ; String onclick = "document.getElementById('" + hiddenInputFieldID + "').value='" + String . valueOf ( tabindex ) + "';" ; AJAXRenderer . generateBootsFacesAJAXAndJavaScript ( context , tab , writer , "click" , onclick , false , true ) ; } R . encodeHTML4DHTMLAttrs ( writer , tab . getAttributes ( ) , new String [ ] { "style" , "tabindex" } ) ; UIComponent iconFacet = tab . getFacet ( "anchor" ) ; if ( null != iconFacet ) { iconFacet . encodeAll ( FacesContext . getCurrentInstance ( ) ) ; if ( null != tab . getTitle ( ) ) { writer . writeText ( " " + tab . getTitle ( ) , null ) ; } } else { writer . writeText ( tab . getTitle ( ) , null ) ; } writer . endElement ( "a" ) ; }
Generate the clickable entity of the tab .