Announcement Announcement Module
Collapse
No announcement yet.
onSubmit not working with showForm Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • onSubmit not working with showForm

    Hi friends,
    In one data entry page, I am populating a dropdown list using showForm() method.
    But when I click on the Submit button, the control is not going to the onSubmit() method.

    here is my code:
    Code:
    public ModelAndView onSubmit(Object command) throws ServletException {
    		logger.info("INSIDE INSERT CONTROLLER111111111");
    		TeamMember teamMember = new TeamMember();
    		int empNo = ((TeamMember) command).getEmpNo();
    		String empName = ((TeamMember) command).getEmpName();
    		String projectName = ((TeamMember) command).getProjectName();
    		int projectManagerId = ((TeamMember) command).getProjectManagerId();
    		int clusterManagerId = ((TeamMember) command).getClustureManagerId();
    		String designation = ((TeamMember) command).getDesignation();
    		String location = ((TeamMember) command).getLocation();
    		String psaGrade = ((TeamMember) command).getPsaGrade();
    
    		int status = 0;
    		try {
    			logger.info("INSIDE INSERT CONTROLLER");
    			status = memberJdbc.insert(empNo, empName, designation,
    					projectManagerId, clusterManagerId, location, psaGrade,
    					projectName);
    		} catch (Exception e) {
    			logger.error("", e);
    			logger.info(e);
    			e.getStackTrace();
    		}
    		Map map = new HashMap();
    		if (status == 1) {
    			return new ModelAndView("NewMemberEntry", "Status", map);
    		} else {
    			return new ModelAndView("NewMemberEntry", "Status", map);
    		}
    	}
    protected ModelAndView showForm(HttpServletRequest request,
    			HttpServletResponse response, BindException errors)
    			throws Exception {
    		logger.info("showForm");
    		TeamMember teamMember = new TeamMember();
    		List managerList = new ArrayList();
    		List clusterManagerlist = new ArrayList();
    		try {
    			managerList = jdbc.getProjectManager();
    		} catch (Throwable e) {
    			e.getStackTrace();
    		}
    		try {
    			clusterManagerlist = clusterManagerJdbc.getClusterManagerList();
    		} catch (Throwable e) {
    			logger.error("", e);
    			logger.info(e);
    			e.getStackTrace();
    		}
    		Iterator itr1 = clusterManagerlist.iterator();
    		while (itr1.hasNext()) {
    			teamMember = (TeamMember) itr1.next();
    		}
    		Map map = new HashMap();
    		map.put("managerList", managerList);
    		map.put("clusterManagerList", clusterManagerlist);
    
    		return new ModelAndView("NewMemberEntry", "Model", map);
    	}
    Please help me asap
Working...
X