Package com.vst.model

Examples of com.vst.model.Thickness


    protected Object formBackingObject(HttpServletRequest request) throws Exception {


        if (!isFormSubmission(request)) {

            Thickness thickness = new Thickness();

            if (request.getParameter("thicknessId") != null) {
                int id = Integer.parseInt(request.getParameter("thicknessId"));
                return thicknessManager.getThicknessById((Integer) id);
            }

            if (request.getParameter("edited") != null) {
                request.setAttribute("addition", "?edited=1");
                thickness.setEdited(true);
            }

            return thickness;
        }
View Full Code Here


        if (request.getParameter("cansel") != null) {
            return new ModelAndView("redirect:/lookThickness.html");
        }

        Thickness thickness = (Thickness) command;


        if (thickness.getThicknessId() != null) {
            thicknessManager.update(thickness);
            if (thickness.isEdited()) {

                return new ModelAndView("redirect:updating.html?id=" + thickness.getThicknessId() + "&fieldId=" + request.getParameter("fieldId"));
            }
            return new ModelAndView("redirect:/lookThickness.html");
        } else {
            thicknessManager.insert(thickness);
            if (thickness.isEdited()) {

                return new ModelAndView("redirect:updating.html?id=" + thickness.getThicknessId() + "&fieldId=" + request.getParameter("fieldId"));
            }
            mav.addObject("thickness", new Thickness());
            mav.addObject("result", Integer.valueOf(1));
            return mav;
        }

View Full Code Here

    public boolean supports(Class aClass) {
        return Thickness.class.isAssignableFrom(aClass)//To change body of implemented methods use File | Settings | File Templates.
    }

    public void validate(Object o, Errors errors) {
        Thickness thickness=(Thickness)o;
        if (thickness.getThicknessCount()==null){
            errors.rejectValue("thicknessCount","thicknessCount.error");
        }else{
            if (thicknessManager.exist(thickness) && thickness.getThicknessId()==null){
                errors.rejectValue("thicknessId","thickness.error");
            }
        }
        //To change body of implemented methods use File | Settings | File Templates.
    }
View Full Code Here

        ModelAndView mav = new ModelAndView("insertDiameter");


        if (request.getParameter("addThickness") != null) {

            diameter.getThicknessList().add(new Thickness());
            mav.addObject("diameter", diameter);

            return mav;
        }
        if (request.getParameter("deleteThickness") != null) {
View Full Code Here

               List list=diameter.getThicknessList();

                System.out.println("SIZEEE === "+list.size());

                            for (int i=0; i<list.size(); i++){
                                Thickness e=(Thickness)list.get(i);
                                if (e.getThicknessId().equals(null) || e.getThicknessId().equals(new Integer(-1))){
                                    ok=false;
                                   errors.rejectValue("thicknessList["+i+"]","thicknessCount.error") ;
                                }
                            }
View Full Code Here

TOP

Related Classes of com.vst.model.Thickness

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.