This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

h:outputText: Default Value

 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All, I have a text field that is used to present a date like:
<h utputText value="#{bean.date}"/>. What I want to do is, if the bean date is null, I want a default text to show up for example "month/day/year" in the field. What is the easiest way to accomplish this. My backing Bean is something like:

class Bean {
Date date;
public Date getDate() {
return date;
}

public void setDate(Date date) {
this.date = date;
}
}

Thanks in advance.
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would do:



then


[ October 12, 2005: Message edited by: Rick Beaver ]
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic