I’m developing a portlet for Liferay 6.1. At some point I’m evaluating input from a form. In case of invalid input, I’m displaying an error message with <liferay-ui:error>. Ideally I would like to include the invalid value in that message.
Example: There is a text input that is supposed to accept only numbers. The user enters the letter “A” and submits the form. The portlet displays “Sorry, ‘A’ is not a number.” (I’m aware that I could simply check that on the client. In my case it’s more complex data, though.)
Is there a way to use the value parameter of add(PortletRequest portletRequest, String key, Object value) for this?
I haven’t find such clearly solution and have used my own Error-Output:
The css-class “portlet-msg-error” come from liferay and is for default error-rendering.
On the backend put the “my-custom-error” value to the request:
But I would prefer some solution with using of liferay-error-tag.