In JSF, how can I invoke method in case of conversion failing on any of input fields? I guess I can write my own converters and do all the stuff there, but isn’t there a more simple way?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use a
PreRenderViewEventlistener, and in that method check if validation has failed. This listener method will be called every time just before the view is rendered.E.g.
Consider the following Facelet:
And the following backing bean:
If you press the button without entering a value you’ll see “Error!” being printed in your console, enter a value and you’ll see “Success!”.