Gostaria de saber como faço para formatar o meu HtmlInputText , já que crio ele todo em jsf
public UIComponent CriaTexto(Integer maxLength, Integer size,
Boolean readOnly, Boolean required, Boolean styleObrigatorio,
String nome, String tela, String tipo, String type) {
FacesContext fctx = FacesContext.getCurrentInstance();
ELContext elctx = fctx.getELContext();
Application app = fctx.getApplication();
ExpressionFactory exprFactory = app.getExpressionFactory();
HtmlInputText texto = (HtmlInputText) app
.createComponent(HtmlInputText.COMPONENT_TYPE);
texto.setId(nome);
if (tipo.equals(Constantes.TIPOTRANSACAO)) {
texto.setValueExpression(
"value",
exprFactory.createValueExpression(elctx, "#{transacao"
+ tela + ".campo." + nome + "}", String.class));
} else if (tipo.equals(Constantes.TIPOPESQUISA)) {
texto.setValueExpression(
"value",
exprFactory.createValueExpression(elctx, "#{transacao"
+ tela + ".campo." + nome + "}", String.class));
}
texto.setMaxlength(maxLength);
texto.setSize(size);
texto.setReadonly(readOnly);
texto.setRequired(required);
/* caso for obrigatorio terá uma formatacao diferente */
if (styleObrigatorio) {
texto.setStyle(Constantes.STYLEOBRIGATORIO);
}
texto.setOnkeydown("if(event.keyCode==13) {event.keyCode=9};");
/*
* caso mesmo sendo obrigatorio mas readonly, ficara com a segunda
* formatacao
*/
if (texto.isReadonly()) {
texto.setStyle(Constantes.STYLEREADONLY);
}
return texto;
}
Esse é o codigo que cria o meu HtmlInputText, porém nao sei como faço para formatar ele: Date, Numeric e somente numero