Class RegisterClientSideComponents
java.lang.Object
com.webmethods.caf.faces.component.RegisterClientSideComponents
- All Implemented Interfaces:
EventListener
,FacesListener
,SystemEventListener
Listener for PreRenderComponentEvent system events that takes care of registering
the client-side components (model & validators) for the controls right before the
control is rendered.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Client-side validation of "required" components. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Map<Class<? extends Annotation>,
Class<? extends BaseConstraint>> protected static final String
static final String
protected static final Pattern
protected static final ClientSideValidator
protected static final Validator
Fake validator to render "required" client-side validation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
calculateLocalId
(FacesContext context, UIComponent component) Gets the specified component's id, or the local part of the component's clientId if the component has no fixed id.protected String
calculateNeutralRowClientId
(FacesContext context, UIComponent component) Calculates the client id of the component when all the UIData ancestors are not positioned on a row.protected void
endScriptTagIfStarted
(ResponseWriter writer) Make sure the response writer has started a script tag.getReference
(ELContext elContext, ValueExpression expression) This is used to introspect the ValueReference in order to calculate how to do the client-side validation for the BeanValidator.boolean
isListenerForSource
(Object source) void
processEvent
(SystemEvent event) protected void
registerClientSideBeanValidators
(FacesContext context, UIInput input) Inspect the bean validation constraints linked to the control value and add the equivalent client-side validators.protected void
startScriptTagIfNotStarted
(UIComponent component, ResponseWriter writer) Make sure the response writer has started a script tag.
-
Field Details
-
FLAG_WRITTEN_SHARED_SCRIPT_RESOURCES
- See Also:
-
FLAG_PROCESSED_COMPONENTS
- See Also:
-
RE_LOCAL_ID
-
beanConstraintMap
protected static final Map<Class<? extends Annotation>,Class<? extends BaseConstraint>> beanConstraintMap -
REQUIRED_VALIDATOR
Fake validator to render "required" client-side validation. -
REQUIRED_CLIENT_SIDE_VALIDATOR
-
-
Constructor Details
-
RegisterClientSideComponents
public RegisterClientSideComponents()
-
-
Method Details
-
isListenerForSource
- Specified by:
isListenerForSource
in interfaceSystemEventListener
-
processEvent
- Specified by:
processEvent
in interfaceSystemEventListener
- Throws:
AbortProcessingException
-
calculateNeutralRowClientId
Calculates the client id of the component when all the UIData ancestors are not positioned on a row. -
startScriptTagIfNotStarted
protected void startScriptTagIfNotStarted(UIComponent component, ResponseWriter writer) throws IOException Make sure the response writer has started a script tag.- Parameters:
component
-writer
-- Throws:
IOException
-
endScriptTagIfStarted
Make sure the response writer has started a script tag.- Parameters:
component
-writer
-- Throws:
IOException
-
registerClientSideBeanValidators
protected void registerClientSideBeanValidators(FacesContext context, UIInput input) throws IOException Inspect the bean validation constraints linked to the control value and add the equivalent client-side validators.- Parameters:
context
-input
-- Throws:
IOException
-
calculateLocalId
Gets the specified component's id, or the local part of the component's clientId if the component has no fixed id. -
getReference
This is used to introspect the ValueReference in order to calculate how to do the client-side validation for the BeanValidator.
-