protected String newJavaScript ( final Component component ) { final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "setTimeout(" + "function() {" + "var component = document.getElementById(\"" ) . append ( component . getMarkupId ( ) ) . append ( "\");" ) ; if ( clearValue ) { sb . append ( "component.value = \"\";" ) ; } sb . append ( "component.focus();" ) ; sb . append ( "}, " + this . delay + ")" ) ; return sb . toString ( ) ; }
Factory method that creates the java script code for request focus .