Tuesday, December 20, 2016

Visualforce - Beyond Basics Series 33 - Show error for any Input fields

Is there any standard way for displaying error message for a field ?

When a controller/extension (Or) Trigger uses addError method in Sobject field, it will be displayed under the field in the Visualforce Page.


What about non-sobject field ?

But, if the input field has binding through a non-sobject variable, then there's no standard way of displaying the error message under  the field.


How to show them ?

The error message has to be displayed manually.

Where is the code ?

I have illustrated by simply adding error message in a map in Controller, Then, in Visualforce page, if there's an error, the error message will be displayed.


Any screenshot ?


Walk through in video ?





No comments:

Post a Comment

Thanks for reading my blog !