Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Components and Error Handling / h:Messages  RSS feed

 
R Ben Parsons
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.
 
Venkat Sadasivam
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.
 
jaini Naveen
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!