Package org.springmodules.xt.examples.mvc.form

Examples of org.springmodules.xt.examples.mvc.form.OfficeView


    private DynamicBeanIntroductor introductor =  new DynamicBeanIntroductor();
    private MemoryRepository store;
   
    protected Object formBackingObject(HttpServletRequest request) throws Exception {
        IOffice office = store.getOffice(request.getParameter("officeId"));
        OfficeView view = null;
        if (office != null) {
            IntroductorSet set = new IntroductorSet(office.getEmployees(), new Class[]{EmployeeView.class}, new Class[]{IEmployee.class}, this.introductor);
            view = (OfficeView) this.introductor.introduceInterfaces(office, new Class[]{OfficeView.class}, new Class[]{IOffice.class});
            view.setSelectableEmployees(set);
        } else {
            throw new RuntimeException("No office.");
        }
        return view;
    }
View Full Code Here


        }
        return view;
    }
   
    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
        OfficeView view = (OfficeView) command;
        Collection<EmployeeView> empsList = view.getSelectableEmployees();
        IOffice office = (IOffice) this.introductor.getTarget(view);
       
        for (Iterator it = empsList.iterator(); it.hasNext();) {
            EmployeeView emp = (EmployeeView) it.next();
            if (emp.getSelected() != null && emp.getSelected().booleanValue() == true) {
View Full Code Here

TOP

Related Classes of org.springmodules.xt.examples.mvc.form.OfficeView

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.