This commit is contained in:
Inohara 2023-05-15 14:32:59 +04:00
parent 01d1143337
commit c2a7538da2
3 changed files with 11 additions and 11 deletions

View File

@ -10,6 +10,8 @@ import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.sql.Array;
import java.util.ArrayList;
@Controller
@RequestMapping("/order")

View File

@ -21,15 +21,13 @@
<option th:each="value: ${suppliers}" th:selected="${selectedSupplier != null and selectedSupplier == value.id}" th:value="${value.id}" th:text=" ${value.name}"></option>
</select>
</div>
<p class="d-flex justify-content-between">
<label>Продукты:</label>
<div th:each="product : ${products}">
<input type="checkbox" name="genres" th:text="${product.name} + '(Цена: ' + ${product.cost} + ') '"
th:value="${product.id} "
th:field="*{productsId}"
/>
</div>
</p>
<label>Продукты:</label>
<select id="author" class="form-select" multiple size="6" th:field="*{productsId}" >
<option th:each="product: ${products}"
th:value="${product.id}"
th:text="${product.name}" ></option>
</select>
</form>
</div>

View File

@ -8,9 +8,9 @@
<div layout:fragment="content">
<form action="#" th:action="@{/order/dop}" th:object="${productDto}" method="get">
<div class="mb-3">
<label for="author" class="form-label">Продукт</label>
<label for="product" class="form-label">Продукт</label>
<select id="author" class="form-select" th:field="*{id}" th:name="${selectedProduct}">
<select id="product" class="form-select" th:field="*{id}" th:name="${selectedProduct}">
<option th:each="value: ${products}" th:selected="${selectedProduct != null and selectedProduct == value.id}" th:value="${value.id}" th:text="${value.name}"></option>
</select>
</div>