• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about rendered attribute

 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok here is the situtation:

Backing Bean



Utility class



JSF page



throws a DateNotFoundException. I dont want this to happen - I want to display "" if the end date is null.

So, I tried



and that didn't work.

How do I go about achieving this without making a change to the checkNotNull() function in my utility class

[ May 21, 2006: Message edited by: Mike Corleone ]

[ May 21, 2006: Message edited by: Mike Corleone ]
[ May 21, 2006: Message edited by: Mike Corleone ]
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Corleone:
I dont want this to happen - I want to display "" if the end date is null.


So, why are you throwing the exception. Just return an empty string would work I hope.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that will work. But i dont want to modify the function in my utility class



as this function is used in several places. any other solution? (apart from adding a new fn to the utility class that does the same check except that it returns "" instead of throwing exception).
 
g madhava
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the method which you have in the backing bean to the below.

public Date getEnd() {
return someUtiltyClass.checkNotNull(end);
}


 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by g madhava:
Change the method which you have in the backing bean to the below.


Simply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic