Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Custom Components and Error Handling / h:Messages  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to return some useful feedback to a JSF page from my custom component in the event of an error. I initially thought to use the h:message tag, but am having some problems. The sort of code I am using is:



But nothing is being displayed on my JSF page. I have a UI, Tag and Renderer class, but no validation or conversion classes. In case it's relevant, the UI class extends UIOutput.

So question 1 - is this the right way to handle errors in custom components.
If yes, question 2 is - what am I doing wrong??

I've done a lot of searching around h:message and FacesMessage, but nearly everything I find is implemented in a custom validator, not a custom component.

Any help appreciated!

Rob.
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your custom component which method does the validation?

If you do validation in decode() method, the error message will appear, if you do in encode() or encodeEnd(), I doubt.
 
R Ben Parsons
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not doing any validation as it's not an input component. Also my decode is not firing at all ... again I think this is because its a UIOutput component.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To create custom component for the messages custome h:messages component
[ September 24, 2008: Message edited by: jaini Naveen ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!