06-06-2014 11:58 AM
I have a field validator method which needs to be able to distinguish between layout modes of "create" and "edit", and do slightly different validation in those cases.
The best solution I have managed to find looks like this:
public void validateMyField(FacesContext context, UIComponent component, Object value) {
boolean isCreateMode =
(context.getExternalContext().getRequestParameterMap().get("document_create") != null);
if (isCreateMode)
//...validation A...
else
//...validation B...
}
This lookup seems somewhat fragile; is there a better approach? I thought about creating two different validator methods for create and edit, but when the layout is in "create" or "edit" mode, the widget is always in "edit" mode, so I can only define the one validator.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.