Examples of FormFragment


Examples of com.volantis.mcs.layouts.FormFragment

        attributes.setFormData(formInstance);
        attributes.setAction(new LiteralLinkAssetReference("testaction"));
        attributes.setMethod("post");
        attributes.setFormSpecifier(formSpecifier);
        attributes.setFormDescriptor(fd);
        FormFragment formFragment = new FormFragment(layout);
        formFragment.setName(fragmentName);
        FormFragmentInstance formFragmentInstance = new FormFragmentInstance(
                NDimensionalIndex.ZERO_DIMENSIONS);
        formFragmentInstance.setFormat(formFragment);
        Link link = new Link(fragmentName, URLConstants.NEXT_FORM_FRAGMENT, styles);
        link.setFormFragment(formFragmentInstance);
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

        Fragment innerFrag = new Fragment(canvasLayout);
        innerFrag.setName("innerFrag");
        innerFrag.setParent(outerFrag);

        FormFragment formFrag1 = new FormFragment(canvasLayout);
        formFrag1.setName("formFrag1");

        FormFragment formFrag2 = new FormFragment(canvasLayout);
        formFrag2.setName("formFrag2");

        Form form = new Form(canvasLayout);
        form.setName("form");
        form.addFormFragment(formFrag1);
        form.addFormFragment(formFrag2);
        form.setParent(innerFrag);

        Grid grid = new Grid(canvasLayout);
        grid.setRows(2);
        grid.setColumns(1);
        grid.setParent(form);
        grid.attributesHaveBeenSet();
        formFrag1.setParent(grid);
        formFrag2.setParent(grid);

        Pane pane1 = new Pane(canvasLayout);
        pane1.setName("pane1");
        pane1.setParent(formFrag1);

        Pane pane2 = new Pane(canvasLayout);
        pane2.setName("pane2");
        pane2.setParent(formFrag2);

        MarinerURL requestURL = context.getRequestURL(false);
        requestURL.setParameterValue("vfrag", "f1");

        try {
            // Set the children of the formats.
            outerFrag.setChildAt(innerFrag, 0);
            innerFrag.setChildAt(grid, 0);
            grid.setChildAt(formFrag1, 0);
            grid.setChildAt(formFrag2, 1);
            formFrag1.setChildAt(pane1, 0);
            formFrag2.setChildAt(pane2, 0);

            // Set up the FormatScopes correctly.
            DeviceLayoutReplicator replicator = new DeviceLayoutReplicator();
            replicator.replicate(canvasLayout);
        } catch (LayoutException e) {
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

        // getAttribute  return null).
        attributes.setInitial(new LiteralTextAssetReference("foobar"));
        final XFFormAttributes formAttributes = new XFFormAttributes();
        formAttributes.setFormSpecifier(formSpecifier);
        attributes.setFormAttributes(formAttributes);       
        form.addFormFragment(new FormFragment(null));
        result = protocol.getInitialValue(attributes);
        assertEquals("foobar", result);
    }
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

        if (form.isFragmented()) {
            if (logger.isDebugEnabled()) {
                logger.debug("Enclosing form is fragmented.");
            }

            FormFragment fragment = paneInstance.getFormat().
                    getEnclosingFormFragment();
            if (logger.isDebugEnabled()) {
                logger.debug("Enclosing form fragment is " + fragment);
            }

            // The pane is not in any fragment so always include it.
            if (fragment == null) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Pane is not in any form fragment so will " +
                            "always be displayed");
                }
                return true;
            }

            FormFragment currentFormFragment =
                    pageContext.getCurrentFormFragment();
            if (logger.isDebugEnabled()) {
                logger.debug("Current form fragment is " + currentFormFragment);
            }
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

    public void updateFormFragmentationState(Form form) throws LayoutException {

        String formFragmentName = updateFormFragmentationState(form.getName());

        if (formFragmentName == null) {
            FormFragment defFrag = form.getDefaultFormFragment();
            if (defFrag == null) {
                formFragmentName = null;
            } else {
                formFragmentName = defFrag.getName();
            }
            if (logger.isDebugEnabled()) {
                logger.debug("Using default Form fragment of " +
                        formFragmentName + " instead");
            }
        }

        if (logger.isDebugEnabled()) {
            logger.debug("Form Fragment name is " + formFragmentName);

            // If the fragment name was set then find the fragment in the
            // device layout and store it in the context. If the fragment
            // was set but could not be found then throw an exception.
        }

        FormFragment fragment = null;
        if (formFragmentName != null) {
            fragment = (FormFragment) getDeviceLayout().
                    retrieveFormat(formFragmentName,
                                   FormatType.FORM_FRAGMENT);
            if (fragment == null) {
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

                // caching is not supported for fragmented forms
                if (cachingDirectives != null) {
                    cachingDirectives.disable();
                }

                FormFragment fragment = (FormFragment)instance.getFormat();
                Format child = fragment.getChildAt(0);

                // If there is no child then there is nothing to write, not
                // even a link.
                if (child == null) {
                    return;
                }

                FormFragment currentFragment =
                        context.getCurrentFormFragment();

                FormatInstance childInstance =
                        context.getFormatInstance(
                                child, instance.getIndex());
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

    // Javadoc inherited.
    public AbstractFormFragment getPreviousFormFragment(
            AbstractFormFragment current) {
        FormFragmentInstance currentFormFragmentInstance =
            (FormFragmentInstance) current;
        FormFragment fragment = ((Form)format).getPreviousFormFragment(
                (FormFragment) currentFormFragmentInstance.getFormat());
        FormFragmentInstance fragmentInstance = null;
        if (fragment != null) {
            fragmentInstance = (FormFragmentInstance)context.
                getFormatInstance(fragment,NDimensionalIndex.ZERO_DIMENSIONS);
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

    // Javadoc inherited.
    public AbstractFormFragment getNextFormFragment(
            AbstractFormFragment current) {
        FormFragmentInstance currentFormFragmentInstance =
                                               (FormFragmentInstance) current;
        FormFragment fragment = ((Form)format).getNextFormFragment(
                (FormFragment) currentFormFragmentInstance.getFormat());
        FormFragmentInstance fragmentInstance = null;
        if (fragment != null) {       
            fragmentInstance = (FormFragmentInstance)context.
                getFormatInstance(fragment,NDimensionalIndex.ZERO_DIMENSIONS);
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

     *         fragment in the given form
     */
    private AbstractFormFragment getCurrentFormFragment(AbstractForm form) {
        AbstractFormFragment fragment = null;
        if (form instanceof FormInstance) {
            FormFragment formFragment = context.getCurrentFormFragment();
            FormFragmentInstance formFragmentInstance =
                (FormFragmentInstance) context.getDeviceLayoutContext().
                                  getCurrentFormatInstance(formFragment);
            fragment = formFragmentInstance;
        } else if (form instanceof FragmentableFormData) {
View Full Code Here

Examples of com.volantis.mcs.layouts.FormFragment

    /**
     * This is called after the format and the context have been set and allows
     * the sub class to do any initialisation which depends on those values.
     */
    public void initialise() {
        FormFragment fragment = (FormFragment) format;
        previousLinkText = fragment.getPreviousLinkText();
        nextLinkText = fragment.getNextLinkText();
        previousLinkStyleClass = fragment.getPreviousLinkStyleClass();
        nextLinkStyleClass = fragment.getNextLinkStyleClass();
        prevLinkBefore = fragment.isPreviousLinkBefore() ? "true" : "false";
        nextLinkBefore = fragment.isNextLinkBefore() ? "true" : "false";
        resetFlag = fragment.isResetEnabled() ? "true" : "false";

        super.initialise();
    }
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.