I need to make a kind of final page where all the data that I collected and created at the beginning through 2 forms is detailed. One form is data collection to create a work order in a workshop and the other form creates an owner. The owner form should redirect me to the work order form when you click the create owner button but instead it takes me to a list of orders that I created. Within that list of orders I added a button that allows me to see the details. Here is where I have a problem. When wanting to see the details, it only lets me see the ones in the "order" class and I want all the detailed fields to be visible.
I have the main controller like this:
@RequestMapping( value = "/ordenFinal", method = RequestMethod.GET)
public ModelAndView ordenFinalGet(@RequestParam("id") long idOrdenDeTrabajo){
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("ordenT", daoOrdenDeTrabajo.findOne(idOrdenDeTrabajo));
modelAndView.setViewName("ordenFinal");
return modelAndView;
}
And this is the HTML:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</link>
<title>Orden</title>
</head>
<body>
<div class="container">
<a th:href = "@{/formularioOrdenTrabajo}"> Crear otra orden de trabajo </a>
<h1>ORDEN DE TRABAJO</h1>
<form th:action="ordenFinal" th:object="${ordenDeTrabajo}" method="post">
<input type="hidden" th:field="${ordenT.idOrdenDeTrabajo}"/>
<br>
<p th:text = "'N° de Orden: ' + ${ordenT.getIdOrdenDeTrabajo()}"></p>
</br>
<table class="table">
<tr>
<th>Propietario</th>
<th>DNI</th>
<th>Direccion</th>
<th>Telefono</th>
</tr>
<tr th:each="pro : ${ordenT.listaOrdenPropietarioO}">
<td th:text="${pro.getPropietario().getNombrePropietario()}"></td>
<td th:text="${pro.getPropietario().getDni()}"></td>
<td th:text="${pro.getPropietario().getDireccion()}"></td>
<td th:text="${pro.getPropietario().getTelefono()}"></td>
</tr>
<tr>
<th>Marca</th>
<th>Patente</th>
<th>Fecha de Ingreso</th>
</tr>
<tr th:each="orden : ${ordenT}">
<td th:text="${orden.getMarca()}"></td>
<td th:text="${orden.getNumeroPatente()}"></td>
<td th:text="${orden.getFechaIngreso()}"></td>
</tr>
<tr>
<th>Repuesto</th>
<th>Costo del Repuesto</th>
<th>Costo por Horas trabajadas </th>
</tr>
</table>
</form>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" />
</div>
</body>
</html>
When I run the project and enter the page, it appears like this:
What I am looking for is that each parameter can be detailed just below the name and for some reason it does not. It's as if the parameters I give were empty. I check MySQL and all the data are loaded in the list without any problem, but still I do not get the way they can appear.