Package org.apache.cocoon.forms.flow.java

Examples of org.apache.cocoon.forms.flow.java.FormInstance


        // Create a empty Bean
        Employee employee = new Employee();
        // Fill some initial data to the bean
        employee.setId(1);
        // Load form descriptor
        FormInstance form = new FormInstance("forms/employee.xml");
        // Load form binding
        form.createBinding("forms/employee-binding.xml");
        // Load the Bean to the form
        form.load(employee);
        // Let Cocoon Forms handle the form
        form.show("form/employee");
        // Update the Bean based on user input
        form.save(employee);
        // Update Bean in Database
        broker.store(employee);
        // Send response to the user
        doShowEmployee();
    }
View Full Code Here


        // Fill some initial data to the bean
        employee.setId(id);
        // Load bean based on the given PrimaryKey
        employee = (Employee) broker.getObjectByIdentity(new Identity(employee, broker));
        // Load form descriptor
        FormInstance form = new FormInstance("forms/employee.xml");
        // Load form binding
        form.createBinding("forms/employee-binding.xml");
        // Load the Bean to the form
        form.load(employee);
        // Let Cocoon Forms handle the form
        form.show("form/employee");
        // Update the Bean based on user input
        form.save(employee);

        // Update Bean in Database
        broker.store(employee);

        // Send response to the user
View Full Code Here

public class FormFlow extends AbstractContinuable {

    public void doEditForm1() {

        FormInstance form = new FormInstance("forms/form1.xml");

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

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

        repeater.addRow();
        field = (Field) repeater.getWidget(1, "firstname");
        field.setValue("Lucien");

        form.show("form/form1");

        sendPage("page/form1-result", new VarMap().add("email", ((Field)form.getChild("email")).getValue())
                                                  .add("somebool", ((BooleanField)form.getChild("somebool")).getValue())
                                                  .add("firstname", ((Field)((Repeater)form.getChild("contacts")).getWidget(1, "firstname")).getValue()));
    }
View Full Code Here

        Contact contact = new Contact();
        contact.setId(1);
        contact.setFirstName("Hermann");
        bean.addContact(contact);

        FormInstance form = new FormInstance("forms/form2.xml", "forms/form2-binding.xml");
        form.load(bean);
        form.show("form/form2");
        form.save(bean);
                                        
        sendPage("page/form2-result", new VarMap().add("form2bean", bean));
    }
View Full Code Here

        // Create a empty Bean
        Employee employee = new Employee();
        // Fill some initial data to the bean
        employee.setId(1);
        // Load form descriptor
        FormInstance form = new FormInstance("forms/employee.xml");
        // Load form binding
        form.createBinding("forms/employee-binding.xml");
        // Load the Bean to the form
        form.load(employee);
        // Let Cocoon Forms handle the form
        form.show("form/employee");
        // Update the Bean based on user input
        form.save(employee);
        // Update Bean in Database
        broker.store(employee);
        // Send response to the user
        doShowEmployee();
    }
View Full Code Here

        Employee employee = new Employee();
        // Fill some initial data to the bean

        employee.setId(id);
        // Load form descriptor
        FormInstance form = new FormInstance("forms/employee.xml");
        // Load form binding
        form.createBinding("forms/employee-binding.xml");
        // Load the Bean to the form
        form.load(employee);
        // Let Cocoon Forms handle the form
        form.show("form/employee");
        // Update the Bean based on user input
        form.save(employee);
        // Update Bean in Database
        broker.store(employee);
        // Send response to the user
        doShowEmployee();
    }
View Full Code Here

        // Fill some initial data to the bean
        employee.setId(id);
        // Load bean based on the given PrimaryKey
        employee = (Employee) broker.getObjectByIdentity(new Identity(employee, broker));
        // Load form descriptor
        FormInstance form = new FormInstance("forms/employee.xml");
        // Load form binding
        form.createBinding("forms/employee-binding.xml");
        // Load the Bean to the form
        form.load(employee);
        // Let Cocoon Forms handle the form
        form.show("form/employee");
        // Update the Bean based on user input
        form.save(employee);

        // Update Bean in Database
        broker.store(employee);

        // Send response to the user
View Full Code Here

public class FormFlow extends AbstractContinuable {

    public void doEditForm1() {

        FormInstance form = new FormInstance("forms/form1.xml");

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

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

        repeater.addRow();
        field = (Field) repeater.getWidget(1, "firstname");
        field.setValue("Lucien");

        form.show("form/form1");

        sendPage("page/form1-result", new VarMap().add("email", ((Field)form.getChild("email")).getValue())
                                                  .add("somebool", ((BooleanField)form.getChild("somebool")).getValue())
                                                  .add("firstname", ((Field)((Repeater)form.getChild("contacts")).getWidget(1, "firstname")).getValue()));
    }
View Full Code Here

        Contact contact = new Contact();
        contact.setId(1);
        contact.setFirstName("Hermann");
        bean.addContact(contact);

        FormInstance form = new FormInstance("forms/form2.xml", "forms/form2-binding.xml");
        form.load(bean);
        form.show("form/form2");
        form.save(bean);
                                        
        sendPage("page/form2-result", new VarMap().add("form2bean", bean));
    }
View Full Code Here

        // Fill some initial data to the bean
        employee.setId(id);
        // Load bean based on the given PrimaryKey
        employee = (Employee) broker.getObjectByIdentity(new Identity(employee, broker));
        // Load form descriptor
        FormInstance form = new FormInstance("forms/employee.xml");
        // Load form binding
        form.createBinding("forms/employee-binding.xml");
        // Load the Bean to the form
        form.load(employee);
        // Let Cocoon Forms handle the form
        form.show("form/employee");
        // Update the Bean based on user input
        form.save(employee);

        // Update Bean in Database
        broker.store(employee);

        // Send response to the user
View Full Code Here

TOP

Related Classes of org.apache.cocoon.forms.flow.java.FormInstance

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.