myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Myfaces Wiki] Update of "ConvertBoolean" by KenWeiner
Date Tue, 20 Sep 2005 17:52:39 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by KenWeiner:

New page:
= Introduction =

It is often necessary to display a Boolean (true/false) on a web page using custom Strings
to represent the true and false values.  For example, you might want to display "Yes" instead
of "true" and "No" instead of "false".

This <t:convertBoolean> tag, which uses the BooleanConverter internally, can be used
to accomplish such formatting.  Its usage is analagous to the use of <f:convertDateTime>
to format a java.util.Date.

= Example =

<h:outputText value="#{backingBean.customer.enjoysJazz}">
    <t:convertBoolean trueValue="Yes" falseValue="No"/>

The "backingBean.customer.enjoysJazz" value binding expression above represents a java.lang.Boolean

View raw message