Examples of XFActionAttributes


Examples of com.volantis.mcs.protocols.XFActionAttributes

    protected void checkActionInputShortcut(boolean generated,
                                            boolean styled) throws ProtocolException {

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();
        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        // Setup test for normal behaviour for input tag generation (submit)
        String shortcut = "1";
        String name = "My Name";
        String actionType = "submit";
        String caption = "This is my caption";

        attributes.setShortcut(new LiteralTextAssetReference(shortcut));
        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));

        protocol.doActionInput(buffer, attributes);
        String actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
                "<input " +
View Full Code Here

Examples of com.volantis.mcs.protocols.XFActionAttributes

        requestContext.expects.getEnvironmentContext().returns(envContext);
        envContext.expects.getCachingDirectives().returns(null);
        strategy.expects.getCharacterData().returns(VALUE_FROM_BODY);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes attributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        attributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        XFSetValueElementImpl setValue =
                new XFSetValueElementImpl(context, strategy);
View Full Code Here

Examples of com.volantis.mcs.protocols.XFActionAttributes

        requestContext.expects.getEnvironmentContext().returns(envContext);
        envContext.expects.getCachingDirectives().returns(null);
        strategy.expects.getCharacterData().returns(VALUE_FROM_BODY);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes actionAttributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        actionAttributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        assertNull(actionAttributes.getInitial());
        assertNull(actionAttributes.getValue());
        assertNull(actionAttributes.getFieldDescriptor().getInitialValue());
        XFSetValueElementImpl setValue =
                new XFSetValueElementImpl(context, strategy);
        setValue.callOpenOnProtocol(context, attributes);
        setValue.callCloseOnProtocol(context);

        assertEquals(VALUE_FROM_BODY, actionAttributes.getInitial().getText(
                TextEncoding.PLAIN));
        assertEquals(VALUE_FROM_BODY, actionAttributes.getValue());
        assertEquals(VALUE_FROM_BODY,
                actionAttributes.getFieldDescriptor().getInitialValue());
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.XFActionAttributes

        requestContext.expects.getEnvironmentContext().returns(envContext);
        envContext.expects.getCachingDirectives().returns(null);
        strategy.expects.getCharacterData().returns(null);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes actionAttributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        actionAttributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        assertNull(actionAttributes.getInitial());
        assertNull(actionAttributes.getValue());
        assertNull(actionAttributes.getFieldDescriptor().getInitialValue());
        XFSetValueElementImpl setValue =
                new XFSetValueElementImpl(context, strategy);
        setValue.callOpenOnProtocol(context, attributes);
        setValue.callCloseOnProtocol(context);

        assertEquals(VALUE_FROM_ATTRIBUTE, actionAttributes.getInitial().getText(
                TextEncoding.PLAIN));
        assertEquals(VALUE_FROM_ATTRIBUTE, actionAttributes.getValue());
        assertEquals(VALUE_FROM_ATTRIBUTE,
                actionAttributes.getFieldDescriptor().getInitialValue());
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.XFActionAttributes

            // trigger the submission) then HTMLActionFieldHandler appends this
            // name value pair using the name and initial value specified in
            // the field descriptor of the submit element. In order for our
            // parent submit element to set this flag, we should set the
            // initial value to the value specified.
            XFActionAttributes parentAttributes = ((XFActionAttributes)
                    ((XFSubmitElementImpl)element).getProtocolAttributes());
            parentAttributes.setName(name);
            parentAttributes.setInitial(value);
            parentAttributes.setValue(value);
           
            FieldDescriptor fd = parentAttributes.getFieldDescriptor();
            fd.setName(name);
            fd.setInitialValue(value);           
        } else {           
            String localizedException = EXCEPTION_LOCALIZER.format(
                    "xforms-invalid-setvalue-parent",
View Full Code Here

Examples of com.volantis.mcs.protocols.XFActionAttributes

     * @param context
     */
    public XFSubmitElementImpl(XDIMEContextInternal context) {
        super(XFormElements.SUBMIT, context);

        protocolAttributes = new XFActionAttributes();

        // Add xfsubmit specific events.
        new XFormsFocusEvent().registerEvents(eventMapper);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.