public class IgnoreValidationFailed extends TagHandler
The <o:ignoreValidationFailed>
taghandler allows the developer to ignore validation failures when
executing an UICommand
action. This taghandler must be placed inside an UICommand
component and the
parent UIForm
must be an <o:form>
. When executing an ajax action, make sure that the
parent UIForm
is also included in the <f:ajax execute>
.
For example:
<o:form> ... <h:commandButton value="save valid data" action="#{bean.saveValidData}"> <o:ignoreValidationFailed /> <f:ajax execute="@form" /> </h:commandButton> </o:form>
Note that the model values will (obviously) only be updated for components which have actually passed the validation.
Also the validation messages will still be displayed. If you prefer to not display them, then you'd need to exclude
them from rendering by <f:ajax render>
, or to put a proper condition in the rendered
attribute.
Form
nextHandler, tag, tagId
Constructor and Description |
---|
IgnoreValidationFailed(TagConfig config)
The tag constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(FaceletContext context,
UIComponent parent)
This will create a
PhaseListener for the before phase of PhaseId.PROCESS_VALIDATIONS which will
in turn check if the parent UICommand component has been invoked during the postback and if so, then
set a context attribute which informs the Form to ignore the validation. |
getAttribute, getRequiredAttribute, toString
public IgnoreValidationFailed(TagConfig config)
config
- The tag config.public void apply(FaceletContext context, UIComponent parent) throws IOException
PhaseListener
for the before phase of PhaseId.PROCESS_VALIDATIONS
which will
in turn check if the parent UICommand
component has been invoked during the postback and if so, then
set a context attribute which informs the Form
to ignore the validation.IOException
Copyright © 2012–2014 OmniFaces. All rights reserved.