aspose file tools*
The moose likes JSF and the fly likes how to set ' - -' if there is no value for that column?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to set Watch "how to set New topic
Author

how to set ' - -' if there is no value for that column??

gopal kishan
Ranch Hand

Joined: Feb 23, 2005
Posts: 99
Hi All,

I am using jsf. i need to display the result to the user based on search condition.

ex: i want to display "EMPID", "EMPNAME" "DEPT".

if there is no value for one column i want to set "--" value.

how to do this in JSF???

thanks in advance
Gopal
gopal kishan
Ranch Hand

Joined: Feb 23, 2005
Posts: 99
hi can anybody tell me how to set '--' if the column value return null

how will you use if condition in jsp page using jsf.
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
You could write a custom javax.faces.convert.Converter for that. For example, if you had Date fields that were nullable, you could define a custom DateConverter and even register it as the default converter for Dates.


There is no emoticon for what I am feeling!
gopal kishan
Ranch Hand

Joined: Feb 23, 2005
Posts: 99
Hi Jeff,

Thanks for the reply.

But the JSF document shows that converter used to convert values to particular datatypes.

but in my situation, i getting the result from the database and i want to show it to the user.

if any column does not contain value , then i need to show "--" instead of blank.

how will you do this???
gopal kishan
Ranch Hand

Joined: Feb 23, 2005
Posts: 99
Hi jeff,

I got my desired output. I tried like this it works fine.

<h:column>
<h utputText value="--" rendered="#{ListName.propertyValue==null}">
</h utputText>
<h utputText value="#{ListName.propertyValue}" rendered="#{ListName.propertyValue!=null}"></h utputText>
</h:column>

here ListName is the arraylist which hold the values and
propertyValue is the bean property.

cheers
Gopal
 
wood burning stoves
 
subject: how to set ' - -' if there is no value for that column??