Package com.volantis.mcs.papi

Examples of com.volantis.mcs.papi.XFFormAttributes


        // Create the xfform form element surrounding the xfimplicit. This is
        // required as XFImplicitElement.elementStart gets the current element
        // from the page context.
        formElement = new XFFormElementImpl();
        formAttributes = new XFFormAttributes();
        formAttributes.setAction("action");
        formAttributes.setMethod("post");
        formAttributes.setName("form");

        pageContext.setPolicyReferenceResolver(
View Full Code Here


     * Test the field event attributes initialization. The events checked are:
     * - ON_SUBMIT
     * - ON_RESET
     */
    public void testInitialiseFormEventAttributes() throws Exception {
        XFFormAttributes papiAttributes = new XFFormAttributes();
        final String ON_SUBMIT = "OnSubmit";
        final String ON_RESET = "OnRest";

        referenceResolverMock.expects.resolveQuotedScriptExpression(ON_SUBMIT)
            .returns(new LiteralScriptAssetReference(ON_SUBMIT)).any();

        referenceResolverMock.expects.resolveQuotedScriptExpression(ON_RESET)
            .returns(new LiteralScriptAssetReference(ON_RESET)).any();

        papiAttributes.setOnSubmit(ON_SUBMIT);
        papiAttributes.setOnReset(ON_RESET);

        CanvasAttributes attributes = new CanvasAttributes();

        EventAttributes events = attributes.getEventAttributes(false);
        ScriptAssetReference event = events.getEvent(EventConstants.ON_LOAD);
View Full Code Here

        paneInstance.setDeviceLayoutContext(deviceLayoutContext);
        pageContext.setFormatInstance(paneInstance);
        pageContext.addPaneMapping(testPane);

        // set up xfform element
        final XFFormAttributes xfFormAttributes = new XFFormAttributes();
        final XFFormElementImpl xfFormElement = new XFFormElementImpl();
        xfFormElement.elementStart(requestContext, xfFormAttributes);
        pageContext.setCurrentElement(xfFormElement);

        // set up xfsiselect element
View Full Code Here

                pageContext.getEnvironmentContext().getCachingDirectives();
        if (cachingDirectives != null) {
            cachingDirectives.disable();
        }

        XFFormAttributes attributes = (XFFormAttributes) papiAttributes;

        // Try and find the form with the specified name, if it could not be
        // found then return and skip the element body.
        String formName = attributes.getName();
        Form form = pageContext.getForm(formName);
        if (form == null) {
            skipped = true;
            return SKIP_ELEMENT_BODY;
        }

        TextAssetReference textReference;
        LinkAssetReference linkReference;
        String value;

        // Copy the base attributes.
        pattributes.setId(attributes.getId());

        PolicyReferenceResolver resolver =
                pageContext.getPolicyReferenceResolver();

        // Process the action as a mariner expression.
        linkReference = resolver.resolveQuotedLinkExpression(
                attributes.getAction(), PageURLType.FORM);
        pattributes.setAction(linkReference);

        // Set the form attribute.
        FormInstance formInstance =
                (FormInstance) pageContext.getFormatInstance(
                        form, NDimensionalIndex.ZERO_DIMENSIONS);
        pattributes.setFormData(formInstance);

        // Process the help as a mariner expression.
        textReference =
                resolver.resolveQuotedTextExpression(attributes.getHelp());
        pattributes.setHelp(textReference);

        // Set the method attribute, the default is "get".
        value = attributes.getMethod();
        if (value == null) {
            value = "get";
        }
        pattributes.setMethod(value);

        // Set the name attribute.
        String name = attributes.getName();
        pattributes.setName(name);

        // Process the prompt as a mariner expression.
        textReference = resolver.resolveQuotedTextExpression(
                attributes.getPrompt());
        pattributes.setPrompt(textReference);

        // Set the segment attribute.
        pattributes.setSegment(attributes.getSegment());

        // Setup the fragmentation state for the form
        try {
            pageContext.updateFormFragmentationState(form);
        }
View Full Code Here


    /** Creates new VolantisDSPFormTag */
    public VolantisDSPFormTag() {
        super();
        formAttributes = new XFFormAttributes();
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.papi.XFFormAttributes

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.