Package org.openfaces.component.validation

Examples of org.openfaces.component.validation.ValidationProcessor


    public void encodeEnd(FacesContext context, UIComponent component)
            throws IOException {
        super.encodeEnd(context, component);

        ValidationProcessor processor = ValidationProcessor.getInstance(context);
        HtmlMessages htmlMessages = (HtmlMessages) component;
        if (processor != null) {
            String styleClassName = Styles.getCSSClass(context, component, htmlMessages.getStyle(), htmlMessages.getStyleClass());

            Script clientScript = getClientScript(context, component, styleClassName);
View Full Code Here


        }
    }

    private void renderClientValidatorsIfNeeded(UIComponent component, List<UIComponent> children, FacesContext context) throws IOException {
        UIForm parentForm = Components.getEnclosingForm(component);
        ValidationProcessor processor = ValidationProcessor.getInstance(context);
        ClientValidationMode validationMode = processor.getClientValidationRuleForForm(parentForm);
        if (!validationMode.equals(ClientValidationMode.OFF)) {
            renderClientValidators(parentForm, validationMode, children, context);
        }
    }
View Full Code Here

        FloatingIconMessage fim = (FloatingIconMessage) component;

        UIComponent forComponent = getForComponent(fim);
        boolean pageDefinedMessage = !fim.isRuntimeDefined();
        ValidationProcessor validationProcessor = ValidationProcessor.getInstance(context);
        if (validationProcessor == null)
            return;


        ClientValidationMode cv = validationProcessor.getClientValidationRule(fim, forComponent);
        UIForm form = Components.getEnclosingForm(fim);
        boolean clientValidation = !cv.equals(ClientValidationMode.OFF);
        boolean useDCVP = validationProcessor.isUseDefaultClientValidationPresentationForForm(form);
        boolean useDSVP = validationProcessor.isUseDefaultServerValidationPresentationForForm(form);

        String forComponentClientId = getForComponentClientId(context, fim);
        if (forComponentClientId == null) {
            Rendering.logWarning(context, "Cannot render floatingIconMessage because can't calculate " +
                    "target component client ID. It may be caused by 'for' attribute absence");
View Full Code Here

        renderMessage(context, component);
        String forComponentClientId = getForComponentClientId(context, component);

        UIComponent forComponent = getForComponent(component);

        ValidationProcessor validationProcessor = ValidationProcessor.getInstance(context);
        if (validationProcessor != null) {
            ClientValidationMode cv = validationProcessor.getClientValidationRule(component, forComponent);
            boolean clientValidation = !cv.equals(ClientValidationMode.OFF);
            if (clientValidation) {
                if (forComponentClientId == null) {
                    Rendering.logWarning(context, "Cannot render floatingIconMessage bacause can't calculate " +
                            "target component client ID. It may be caused by 'for' attribute absence");
                    return;
                }
                UIForm form = Components.getEnclosingForm(component);
                if (validationProcessor.isUseDefaultClientValidationPresentationForForm(form)) {
                    ValidatorUtil.renderPresentationExistsForComponent(forComponentClientId, context);
                }
                Script clientScript = getClientScript(component.getClientId(context), forComponentClientId, component);
                Rendering.renderInitScript(context, clientScript, getJavascriptLibraryUrls(context, clientValidation));
                Styles.renderStyleClasses(context, component);
View Full Code Here

TOP

Related Classes of org.openfaces.component.validation.ValidationProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.