This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes FacesMessages with JSF dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "FacesMessages with JSF dataTable" Watch "FacesMessages with JSF dataTable" New topic
Author

FacesMessages with JSF dataTable

Andy Holm
Ranch Hand

Joined: Jul 03, 2008
Posts: 86
Is there anyway to use <h:message> for a <h:dataTable>? I would like to output messages when the datatable can not be populated with values from the database (via the value attribute) but currently the messages are not appearing on my page when an error occurs.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Are you displaying the message outside the datatable?

The functional requirement is unclear, so I can't give a more detailed help.
Andy Holm
Ranch Hand

Joined: Jul 03, 2008
Posts: 86
Yes, I am trying to display the message outside of my datatable. It looks something like this:

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
I don't see a problem in the as far given information and code. Everything looks fine (expect of the forum's own problem with HTML entities).
Andy Holm
Ranch Hand

Joined: Jul 03, 2008
Posts: 86
Yeah, I am not having much luck debugging this either. When I do a FacesContext.getCurrentInstance().getFacesContext().getMessages() in the RENDER_RESPONSE phase directly before the page is output, I see my FacesMessage. I am not sure why it isn't output on the page. Any debugging tips?

Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Try printing it out in different phases by created a debugging phaselistener that might give you a clue.

Thanks,
Rahul


Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
Andy Holm
Ranch Hand

Joined: Jul 03, 2008
Posts: 86
Rahul,

As you can see from my last message, I have already done that. :-) Everything looks good except for when I try printing it out on my jsp page.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Andy Holm wrote:Yeah, I am not having much luck debugging this either. When I do a FacesContext.getCurrentInstance().getFacesContext().getMessages() in the RENDER_RESPONSE phase directly before the page is output, I see my FacesMessage. I am not sure why it isn't output on the page. Any debugging tips?


I still don't see a problem in the as far given information. You need to elaborate more about the problem. Maybe in flavour of an SSCCE.
 
Consider Paul's rocket mass heater.
 
subject: FacesMessages with JSF dataTable
 
Similar Threads
Prototype tableID in function
Create row index in dataTable
Unable to display header in outer JSF datatable of a nested datatable using facet tag
Model update problem
html inside a h:panel