Guten Tag Kollegen. Ich bin ein Anfänger und versuche eine Spring Programm zu erstellen. Das Problem ist, dass ich versuche auf der Start Seite mit JS verschiedene Seiten aktivieren (ans Licht bringen) ->
Das sind diese Seiten->
Das Problem ist das ich die Seiten die ich ansehen möchte in div container nicht reingestellt kriege ,weil der Controller ganz neue Seite zurück liefert.
Als Ausgang nehmen wir erste Seite Dashboard.->
Jetzt wenn ich auf Daschboard klicke bekomme ich folgende Seite(siehe Foto 1)

also keine Werte sind da.Falls ich aber die Seite durch Aktivierung des Controllers bekomme->
bekomme ich alles richtig nur auf einer anderen Seite->
Die Frage-> Wie kann man das ,was auf dem Foto 2 steht, auf der Seite von Foto 1 bekommen
Javascript:
<script type="text/javascript">
function openPage(pageName, elmnt) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
document.getElementById(pageName).style.display = "block";
document.getElementById(pageName).click();
tablinks = document.getElementsByClassName("tablink");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].style.backgroundImage = "";
}
elmnt.style.backgroundImage = "linear-gradient(to right, #68a54b ,#e4ffde )";
}
function open(){
document.getElementById("defaultOpen").click();
}
HTML:
<button class="tablink" onclick="openPage('Dashboard', this);">Dashboard</button>
<button class="tablink" id="defaultOpen" onclick="openPage('Projekte', this)" >Projekte</button>
<button class="tablink" onclick="openPage('Programme', this)">Programme</button>
<button class="tablink" onclick="openPage('Text', this)">Text-Referenz</button>
<button class="tablink" onclick="openPage('Users', this)">Users</button>
<button class="tablink" onclick="openPage('Logout', this)">Logout</button>
<br><br><br><br><br>
<div class="tabcontent" id="Dashboard" th:insert="../blocks/Dashboard">
</div>
<div class="tabcontent" id="Projekte" th:insert="../blocks/Projektorganisation.html">
</div>
<div class="tabcontent" id="Programme" th:insert="/addProg.html">
</div>
<div class="tabcontent" id="Text" th:insert="../blocks/Textreferenz.html">
</div>
<div class="tabcontent" id="Users" th:insert="/userList.html">
</div>
<div class="tabcontent" id="Logout" th:insert="../blocks/logout.html">
</div>
Als Ausgang nehmen wir erste Seite Dashboard.->
HTML:
<html xmlns:th="http://www.thymeleaf.org">
<table style="margin:auto;border: 1px solid black;">
<thead><tr><th>Antzahl hochkomplexen Programmen</th><th>Anzahl mittelkomplexen Programmen</th><th>Anzahl geringkomplexen Programmen</th></tr></thead>
<tr th:each="el:${fm}"><td th:text="${el.getHoheKomplex}">A</td>
<td th:text="${el.getMittlereKomplex}">B</td>
<td th:text="${el.getGeringeKomplex}">C</td>
</tr>
<tr th:each="e:${lesb}"><td th:text="${e.getHohe}">D</td>
<td th:text="${e.getMittlere}">E</td>
<td th:text="${e.getGeringe}">F</td>
</tr>
</table>
</div>

also keine Werte sind da.Falls ich aber die Seite durch Aktivierung des Controllers bekomme->
Java:
@Controller
@RequestMapping("/Dashboard")
public class DashController {
@Autowired
private MacroDatenRepository mcRepository;
@Autowired
private SascoProjektRepository projRepository;
@Autowired
private ProgrammRepository progRepository;
@GetMapping//("{fm}")
public String getFm(Model model) {
model.addAttribute("countProj",projRepository.count());
model.addAttribute("fm",mcRepository.getFm());
model.addAttribute("lesb",mcRepository.getLesb());
model.addAttribute("countProg",progRepository.count());
return "../blocks/Dashboard.html";
}
}

Die Frage-> Wie kann man das ,was auf dem Foto 2 steht, auf der Seite von Foto 1 bekommen