anchor.diff:                  getAllCompany();
   
   
  +                /*Based on company Selection load department data */
  +
                   $("#listOfCompany").change(function () {
                       var id = $(this).val();
                       id = parseInt(id);
                       var company = new Object();
                       company.id = id;
  -                    getAllDepartment(company.id)
  +                    getSelectedDepartment(company.id,"Select Department")
                   });
   
                   /* populate Product list when page load */
  
positive.code:                     });
                  }
  
  
                  /* Load Department data to select box data using ajax */
  
                  function getAllDepartment(companyId) {
                      $('#listOfDepartment').empty();
                      $.ajax({
                          headers: {
                              'Accept': 'application/json',
                              'Content-Type': 'application/json'
                          },
                          'type': 'POST',
                          url: 'http://localhost:8080/department/departmentListByCompany',
                          'data': JSON.stringify(companyId),
                          'dataType': 'json',
                          success: function (data) {
                              var collaboration;
                              collaboration += '<option id="defaultOptDepartment" value="0">Select Department</option>';
                              $.each(data, function (i, d) {
                                  collaboration += "<option value=" + d.id + ">" + d.name + "</option>";
                              });
  
                              $('#listOfDepartment').append(collaboration);
                          },
                          error: function (e) {
                          }
                      });
                  }
  
  
                  /* Load Department data to select box at edit time */
  
                  function setOptionVal(id, data) {
                      $('#listOfDepartment').empty();
                      console.log(data);
                      var collaboration;
                      collaboration += '<option id="defaultOptDepartment" value="0">Select Department</option>';
                      collaboration += "<option value=" + id + ">" + data + "</option>";
                      $('#listOfDepartment').append(collaboration);
                  }
  
  
              });
              //
  
  
negative.code:                 };
  
  
  
  
                  /* Load Department data to select box data using ajax */
  
                  function getSelectedDepartment(companyId, obj) {
                      $('#listOfDepartment').empty();
                      $.ajax({
                          headers: {
                              'Accept': 'application/json',
                              'Content-Type': 'application/json'
                          },
                          'type': 'POST',
                          url: 'http://localhost:8080/department/departmentListByCompany',
                          'data': JSON.stringify(companyId),
                          'dataType': 'json',
                          success: function (data) {
                              var collaboration;
                              collaboration += '<option id="defaultOptDepartment" value="0">Select Department</option>';
                              $.each(data, function (i, d) {
                                  collaboration += "<option value=" + d.id + ">" + d.name + "</option>";
                              });
  
                              $('#listOfDepartment').append(collaboration);
                              console.log("testing....");
                              $('#listOfDepartment option:contains("' + obj + '")').prop('selected', 'selected');
                          },
                          error: function (e) {
                          }
                      });
                  }
  
  
                  /* set selected row data to product form for edit */
  
                  function setDataToProductForm(newProduct) {
                      document.getElementById('productForm').style.display = "block";
                      $("#updateProduct").show();
                      $("#saveProduct").hide();
  