You should use a converter to perform the formatting for you.

A couple of links that a quick google search turned up.

http://www.laliluna.de/assets/tutorials/jsf-converter-en.pdf
http://www.jsf-faq.com/faqs/faces-conversion.html -- see the "More
details:" section at the bottom.

On 1/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Vladimir Coutinho <[EMAIL PROTECTED]> wrote on 01/03/2006 03:43:59 PM:
>
>
>  > I'm trying to output a row of a table and I need a diferent format.
>  > There is a way to use a function to format the output in jsf?
>
>
> > On 1/3/06, Simon Kitching <[EMAIL PROTECTED] > wrote:
> > On Mon, 2006-01-02 at 15:41 -0300, Vladimir Coutinho wrote:
>  > > I'm trying to use a function to format the text of the outputText:
>  > >  <h:outputText
>  > >
> value="#{util.text.FormatText.formatCNPJ_CPF(c.CNPJ_CPF)}"/>
>  > >
>  > > But I'm having the following error:
>  > >
>  > > javax.servlet.ServletException: Invalid expression:
>  > > '${util.text.FormatText.formatCNPJ_CPF(c.CNPJ_CPF)}'
>  >
>  > Yep, that's an invalid EL expression. EL doesn't support passing
>  > parameters. Why do you want to do this? Are you trying to output data in
>  > a row of a table, or perhaps you are trying to use c:forEach?
>  >
>  >
>  > Regards,
>  >
>  > Simon
>
> Vladimir, if the "styleClass" attribute of <h:outputText does not do what
> you want, I think one way to achieve what you want is to have a getter
> method in your bean do the formatting work for you. Then you can reference
> that method in the usual way using EL.
>
> Regards,
> Geeta
>

Reply via email to