Package org.apache.cocoon.woody.formmodel

Examples of org.apache.cocoon.woody.formmodel.Form


        if (localeStr != null)
            locale = I18nUtils.parseLocale(localeStr, locale);

        Source source = resolver.resolveURI(formSource);
        try {
            Form form = formManager.createForm(source);

            Request request = ObjectModelHelper.getRequest(objectModel);
            FormHandler formHandler = null;

            if (formHandlerClassName != null) {
                // TODO cache these classes
                Class clazz = Class.forName(formHandlerClassName);
                formHandler = (FormHandler)clazz.newInstance();
                LifecycleHelper.setupComponent(formHandler, null, null, manager, null, null);
                form.setFormHandler(formHandler);
            }

            FormContext formContext = new FormContext(request, locale);

            boolean finished = form.process(formContext);
            request.setAttribute(formAttribute, form);

            if (finished)
                return Collections.EMPTY_MAP;
            else
View Full Code Here


        this.serviceManager = serviceManager;
    }

    public void handleActionEvent(FormContext context, ActionEvent actionEvent) {
        String action = actionEvent.getActionCommand();
        Form form = actionEvent.getSourceWidget().getForm();
        if (action.equals("updatemodels")) {
            Field make = (Field)form.getWidget("make");
            Field model = (Field)form.getWidget("model");

            String src = "cocoon:/cars/" + make.getValue();
            SelectionList list = new DynamicSelectionList(model.getDatatype(), src, serviceManager);
            model.setSelectionList(list);
        }
View Full Code Here

    public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
            throws Exception {
        String formSource = parameters.getParameter("form-definition");
        String formAttribute = parameters.getParameter("attribute-name");

        Form form = formManager.createForm(resolver.resolveURI(formSource));

        Field birthDate = (Field)form.getWidget("birthdate");
        birthDate.setValue(new Date());

        Repeater repeater = (Repeater)form.getWidget("contacts");
        repeater.addRow();
        Field field = (Field)repeater.getWidget(0, "firstname");
        field.setValue("Jules");

        repeater.addRow();
View Full Code Here

        String formAttribute = parameters.getParameter("attribute-name");

        Source source = null;
        try {
            source = resolver.resolveURI(formSource);
            Form form = formManager.createForm(source);

            Request request = ObjectModelHelper.getRequest(objectModel);
            request.setAttribute(formAttribute, form);
        } finally {
            resolver.release(source);
View Full Code Here

        if (localeStr != null)
            locale = I18nUtils.parseLocale(localeStr, locale);

        Source source = resolver.resolveURI(formSource);
        try {
            Form form = formManager.createForm(source);

            Request request = ObjectModelHelper.getRequest(objectModel);
            FormHandler formHandler = null;

            if (formHandlerClassName != null) {
                // TODO cache these classes
                Class clazz = Class.forName(formHandlerClassName);
                formHandler = (FormHandler)clazz.newInstance();
                LifecycleHelper.setupComponent(formHandler, null, null, manager, null, null, null);
                formHandler.setup(form);
                form.setFormHandler(formHandler);
            }

            FormContext formContext = new FormContext(request, locale);

            boolean finished = form.process(formContext);
            request.setAttribute(formAttribute, form);

            if (finished)
                return Collections.EMPTY_MAP;
            else
View Full Code Here

TOP

Related Classes of org.apache.cocoon.woody.formmodel.Form

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.