Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

displaying boolean values in dataTable  RSS feed

 
madhuri madhuri
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
This is my very first application in JSF. I am trying to display values that are in the database. This table has got a bunch of boolean values. When I display the values, they are shown as true/false but i want it to be displayed as yes/no.

This is what i m doing...

<h:column>
<f:facet name="header">
<h:commandLink styleClass="table-header" actionListener="#{rulesBean.sort}">
<h utputText value="Archived" />
<f aram name="column" value="archived" />
</h:commandLink>
</f:facet>
<h utputText value="#{rule.archived}"/>
</h:column>

Can anyone suggest how this can be done?

Thanks,
~M
 
Bagwan Mehrat
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The MyFaces Tomahawk extension happens to have a convertBoolean tag: http://wiki.apache.org/myfaces/ConvertBoolean

You might use the "rendered" parameter, like:
<hutputText value="Yes" rendered="#{rule.archived}" />
<hutputText value="No" rendered="#{!rule.archived}" />

I don't know if these are good suggestions, but there are many possible methods.
 
madhuri madhuri
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! That works perfectly!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!