Package com.volantis.mcs.protocols.widgets.attributes

Examples of com.volantis.mcs.protocols.widgets.attributes.FieldAttributes


    public FieldElement(XDIMEContextInternal context) {
        // This element is unstyled, and does not require validation.
        super(WidgetElements.FIELD, UnstyledStrategy.STRATEGY,
                context);

        protocolAttributes = new FieldAttributes();
    }
View Full Code Here


    }

    // Javadoc inherited
    protected void initialiseElementSpecificAttributes(XDIMEContextInternal context,
            XDIMEAttributes attributes) throws XDIMEException {
        FieldAttributes fieldAttributes = (FieldAttributes) protocolAttributes;

        fieldAttributes.setRef(attributes.getValue("", "ref"));

        fieldAttributes.setMessageArea(attributes.getValue("", "message-area"));
    }
View Full Code Here

        if (!isWidgetSupported(protocol)) {
            return;
        }

        // Add this field to the current multiple validator instance.
        FieldAttributes fieldAttributes = (FieldAttributes) attributes;

        WidgetDefaultModule widgetModule = (WidgetDefaultModule) protocol.getWidgetModule();
       
        MultipleValidatorBuilder builder = widgetModule.getMultipleValidatorBuilder();
View Full Code Here

            Iterator fieldsIterator = validator.getFieldsIterator();

            boolean firstField = true;

            while (fieldsIterator.hasNext()) {
                FieldAttributes fieldAttributes = (FieldAttributes) fieldsIterator.next();

                // Get attributes of refered input element.
                String inputId = fieldAttributes.getRef();

                XFFormFieldAttributes formFieldAttributes = actualProtocol.getFormFieldAttributes(inputId);

                // If no attributes were found, it means that the refered text
                // input field
                // does not exist. In that case, don't render it.
                if (formFieldAttributes != null) {
                    // Render comma, if this is not the first rendered field.
                    if (!firstField) {
                        scriptWriter.write(", ");
                    }

                    // Get styles of the input element.
                    stylesExtractor.setStyles(formFieldAttributes.getStyles());

                    stylesExtractor.setPseudoClass(null);

                    // Render field name, which equals to ID of the input
                    // element.
                    scriptWriter.write(createJavaScriptString(inputId) + ":{");

                    // Render ID of the input element.
                    scriptWriter.write("inputId: " + createJavaScriptString(inputId));

                    // Render message area for field, if 'message' was specified
                    // as one of the validation error actions.
                    boolean displayMessages = stylesExtractor
                            .containsMessageValidationErrorAction();

                    if (displayMessages) {
                        String messageId = fieldAttributes.getMessageArea();

                        if (messageId != null) {
                            scriptWriter.write(", messageAreaId: " + createJavaScriptString(messageId));
                        }
                    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.widgets.attributes.FieldAttributes

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.