Announcement Announcement Module
Collapse
No announcement yet.
cannot check box in form:checkboxes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • cannot check box in form:checkboxes

    Hi,

    I have form:checkboxes that the data came from referenceData.
    I can retrieve the data but when I select one of the checkboxes and click submit, the form doesn't go to "protected ModelAndView onSubmit(HttpServletRequest request,
    HttpServletResponse response, Object command,BindException errors)" method

    But when I didn't select any of the checkboxes it goes to "onSubmit" method but having nullpointerexception

    Here's my jsp

    Code:
    <form:form commandName=""test_command" method="post" action="custom.htm"  id="bookID">
    		<table class="Style3">
    		<tr>
    		<td>Delete</td>
    		</tr>
    		<tr>
    		<td>
    			<form:checkboxes path="deletedBooks" items="${books}"  cssClass="note" element="checkbox"  delimiter="<br/>"  />
    		</td>
    		</tr>
    		<tr>
    			<td><input type="submit" name="submit" title="Delete Selected"/></td>
    		</tr>	
    		</table>
    	</form:form>
    My bean config
    Code:
      	<bean id="bookCustom" class="com.test.BookController">
        	<property name="formView" value="custom"/>
        	<property name="commandName" value="test_command"/>
        	<property name="successView" value="custom"/>
        	<property name="commandClass" value="com.test.BookDao"/>
      	</bean>
    my BookDao
    Code:
    private Map<String,String> deletedBooks;
    
    //get and setters
    Can someone point me what did I do wrong with my checkboxes?

    Thanks,
    Last edited by geek.shrek; Sep 5th, 2008, 12:13 AM.
Working...
X