Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @Table(name="products")
- public class Product {
- @Getter
- @Setter
- @Id
- private Long productId;
- @Getter
- @Setter
- private Long productName;
- }
- public class QuoteForm {
- @Getter
- @Setter
- private Long quoteId;
- @Getter
- @Setter
- private Long contactId;
- @Getter
- @Setter
- private Set<ProductEntry> products;
- }
- public class ProductEntry {
- @Getter
- @Setter
- private TempProduct product;
- @Getter
- @Setter
- private Long quantity;
- @Getter
- @Setter
- private float discount;
- }
- <form id="productTable" th:object="${quoteForm}">
- <input type="number" th:field="*{contactId}"></input>
- <table id ="productList"
- class="table table-striped table-bordered"
- cellspacing="0"
- width="100%">
- <thead>
- <tr>
- <th>Name</th>
- <th>Quantity</th>
- <th>Discount</th>
- </tr>
- </thead>
- <tbody>
- <tr th:each="product : ${productData.getProducts()}">
- <td name="?">
- <a th:text="${product.getProductName()}"
- th:href="@{|/product/records/${product.getProductId()}|}">
- </a>
- </td>
- <td>
- <input type="number"
- name="?"
- th:field="*{products.quantity}">
- </input>
- </td>
- <td>
- <input type="number" name="?" th:field="*{products.discount}"></input>
- </td>
- </tr>
- </tbody>
Add Comment
Please, Sign In to add comment