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

FacesMessages with JSF dataTable

 
Andy Holm
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I am trying to display the message outside of my datatable. It looks something like this:

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try printing it out in different phases by created a debugging phaselistener that might give you a clue.

Thanks,
Rahul
 
Andy Holm
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic