• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FacesMessages with JSF dataTable

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
It means our mission is in jeapordy! Quick, read this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic