Guest User

Untitled

a guest
Nov 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. @Entity
  2. @Table(name="products")
  3. public class Product {
  4. @Getter
  5. @Setter
  6. @Id
  7. private Long productId;
  8. @Getter
  9. @Setter
  10. private Long productName;
  11. }
  12.  
  13. public class QuoteForm {
  14. @Getter
  15. @Setter
  16. private Long quoteId;
  17. @Getter
  18. @Setter
  19. private Long contactId;
  20. @Getter
  21. @Setter
  22. private Set<ProductEntry> products;
  23. }
  24.  
  25. public class ProductEntry {
  26. @Getter
  27. @Setter
  28. private TempProduct product;
  29. @Getter
  30. @Setter
  31. private Long quantity;
  32. @Getter
  33. @Setter
  34. private float discount;
  35. }
  36.  
  37. <form id="productTable" th:object="${quoteForm}">
  38. <input type="number" th:field="*{contactId}"></input>
  39. <table id ="productList"
  40. class="table table-striped table-bordered"
  41. cellspacing="0"
  42. width="100%">
  43. <thead>
  44. <tr>
  45. <th>Name</th>
  46. <th>Quantity</th>
  47. <th>Discount</th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. <tr th:each="product : ${productData.getProducts()}">
  52. <td name="?">
  53. <a th:text="${product.getProductName()}"
  54. th:href="@{|/product/records/${product.getProductId()}|}">
  55. </a>
  56. </td>
  57. <td>
  58. <input type="number"
  59. name="?"
  60. th:field="*{products.quantity}">
  61. </input>
  62. </td>
  63. <td>
  64. <input type="number" name="?" th:field="*{products.discount}"></input>
  65. </td>
  66. </tr>
  67. </tbody>
Add Comment
Please, Sign In to add comment