Package at.reppeitsolutions.formbuilder.components

Examples of at.reppeitsolutions.formbuilder.components.FormFiller


    }

    @Override
    public void encodeBegin(FacesContext ctx,
            UIComponent component) throws IOException {
        FormFiller formFiller = (FormFiller) component;
        String uuid = UUID.randomUUID().toString();
        FormFillerAttributesContainer container = new FormFillerAttributesContainer();
        container.setFormData(formFiller.getFormData());
        container.setWorkflowState(formFiller.getWorkflowState());
        container.setConstraintClient(formFiller.getConstraintClient());
        container.setMetaDataObject(formFiller.getMetaDataObject());
        container.setMetaDataFetcher(formFiller.getMetaDataFetcher());
        ModelApplicationBean.getInstance().putFormData(uuid, container);
        HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
        formFiller.getIFrame().setSrc(request.getContextPath() + "/pages/formfiller.xhtml?uuid=" + uuid + "&mode=" + formFiller.getMode());

        formFiller.getCallbackButton().setActionExpression(formFiller.getActionExpression());
    }
View Full Code Here


    }

    @Override
    public void encodeEnd(FacesContext ctx,
            UIComponent component) throws IOException {
        FormFiller formFiller = (FormFiller) component;
        ResponseWriter writer = ctx.getResponseWriter();
        writer.write("<script type=\"text/javascript\">");
        if (formFiller.getMode() != null
                && formFiller.getMode().equals(FormFiller.MODE_FILL)) {
            if (formFiller.getSubmitButtonId() != null) {
                writer.write("$(function(){"
                        + "$(\"#" + formFiller.getSubmitButtonId() + "\").attr(\"onclick\",\"submitForm();\");"
                        + "});");
            }
            writer.write("function submitForm() {"
                    + "  var iframe = document.getElementById('" + formFiller.getIFrame().getId() + "');"
                    + "  var innerDoc = iframe.contentDocument || iframe.contentWindow.document;"
                    + "  $(innerDoc).find(\".btn\").click();"
                    + "} "
                    + "function submitParentForm() {"
                    + "  document.getElementById(\"" + FormBuilderInternalRenderer.getHtmlForm(component).getId() + Constants.sep + formFiller.getCallbackButton().getId() + "\").click();"
                    + "}");
        }
        writer.write("$(function(){regIframe('" + formFiller.getIFrame().getId() + "');});"
                + "</script>");
    }
View Full Code Here

                + "</script>");
    }

    @Override
    public void decode(FacesContext ctx, UIComponent component) {
        FormFiller formFillerIFrame = (FormFiller) component;
        MethodBinding action = formFillerIFrame.getAction();
        if(action != null) {
            action.invoke(ctx, null);
        }
    }
View Full Code Here

TOP

Related Classes of at.reppeitsolutions.formbuilder.components.FormFiller

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.