title: onchange function using spring roo distribution (gvnix)
body: <p>I am new to Spring roo( i am using gvnix spring roo distribution for jquery, bootstrap and databale). I have created 3 tables in mysql</p>
  
  <pre><code>CREATE TABLE `categories` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `Category_Name` varchar(50) NOT NULL,
    `Description` varchar(50) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  
  insert  into `categories`(`id`,`Category_Name`,`Description`) values (1,'Facility','facility'),(2,'Ikare','Ikare');
  
  CREATE TABLE `subcategories` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `subcategory_name` varchar(50) NOT NULL,
    `category_id` int(11) NOT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_md1atoxe8wd8bi2fhf9nnw4q0` (`category_id`),
    CONSTRAINT `FK_md1atoxe8wd8bi2fhf9nnw4q0` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  
  insert  into `subcategories`(`id`,`subcategory_name`,`category_id`) values (1,'room service',1),(2,'store',1),(3,'server setup',2),(4,'Travel not working',2);
  </code></pre>
  
  <p>and used <strong>database reverse engineering command</strong> to create the bean file.</p>
  
  <p>and used the for scaffold,jquery,bootstrap and dattable</p>
  
  <p>now after deploying the app into tomcat7 I am able to create categories, subcategories.</p>
  
  <p>My problem is while creating new service desk, the category is showing in dropdown and all sub category is showing in default. But I want when I select the specific category it should display the respective subcategory but not all subcategory for all category.</p>
  
  <p>and also validation is not working means if I don't enter anything in mandatory field I am able to save the data.</p>
  
  <p>Below is my code for create new service.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/jquery/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/datatables" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0"&gt;
      &lt;jsp:directive.page contentType="text/html;charset=UTF-8"/&gt;
      &lt;jsp:output omit-xml-declaration="yes"/&gt;
      &lt;form:create id="fc_com_arat_roo_domain_ServiceDesk" modelAttribute="serviceDesk" path="/servicedesks" render="${empty dependencies}" z="5rY4NJcP8nJ/t0tXbZs8XZLebzs="&gt;
          &lt;field:select field="categoryId" id="c_com_arat_roo_domain_ServiceDesk_categoryId" itemValue="id" items="${categorieses}" path="/categorieses" z="eTrZa7tDsB6IOgAA143b/eECzgs="/&gt;
          &lt;field:select field="subcategoryId" id="c_com_arat_roo_domain_ServiceDesk_subcategoryId" itemValue="id" items="${subcategorieses}" path="/subcategorieses" z="WLOZ5uG2O8vxZDxYu7Gg1q0Zx9w="/&gt;
          &lt;field:input field="comment" id="c_com_arat_roo_domain_ServiceDesk_comment" required="true" z="h/4gHQSwuY162Ci8qehagMY7ZUY="/&gt;
      &lt;/form:create&gt;
      &lt;form:dependency dependencies="${dependencies}" id="d_com_arat_roo_domain_ServiceDesk" render="${not empty dependencies}" z="zpBtjtNE7E7oXm/3C5Dw9BagNsM="/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and  controller is as below:</p>
  
  <pre><code>@RequestMapping(params = "form", produces = "text/html")
      public String createForm(Model uiModel) {
          populateEditForm(uiModel, new ServiceDesk());
          return "servicedesks/create";
      }
  
  void populateEditForm(Model uiModel, ServiceDesk serviceDesk) {
          uiModel.addAttribute("serviceDesk", serviceDesk);
          uiModel.addAttribute("categorieses", Categories.findAllCategorieses());
          uiModel.addAttribute("subcategorieses", Subcategories.findAllSubcategorieses());
      }
  </code></pre>
  
  <p>and below is the log.roo for command i used.</p>
  
  <pre><code>// Spring Roo 1.3.1.RELEASE [rev 8cb81a3] log opened at 2016-02-06 00:33:13
  project --topLevelPackage com.arat.roo --projectName ssd --java 6 --packaging WAR
  // Spring Roo 1.3.1.RELEASE [rev 8cb81a3] log closed at 2016-02-06 00:33:15
  // Spring Roo 1.3.1.RELEASE [rev 8cb81a3] log opened at 2016-02-06 00:34:16
  osgi start --url file:///C:/Users/Arat/.m2/repository/mysql/mysql-connector-java/5.1.20/mysql-connector-java-5.1.20.jar
  hint
  persistence setup --database MYSQL --provider HIBERNATE --databaseName learning --userName root --password Gayathri/?@123
  osgi start --url file:///C:/Users/Arat/.m2/repository/mysql/mysql-connector-java/5.1.20/mysql-connector-java-5.1.20.jar
  database introspect --schema no-schema-required
  database reverse engineer --schema root --package ~.domain --includeTables "categories subcategories service_desk"
  web mvc setup
  web mvc all --package ~.web
  web mvc jquery setup
  web mvc jquery all
  web mvc datatables setup
  web mvc bootstrap setup
  web mvc bootstrap update
  web mvc datatables all 
  jpa gvnix setup
  jpa batch all
  web mvc batch setup
  web mvc batch all
  web mvc datatables detail add --type ~.web.CategoriesController --property subcategorieses
  web mvc datatables detail add --type ~.web.ServiceDeskController --property subcategorieses
  web mvc datatables detail add --type ~.web.ServiceDeskController --property categorieses
  </code></pre>
  
  <p>Could you please help me on this? </p>