You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where resultsList is defined inside a bigger Thymeleaf template as <div th:fragment="resultsList" th:unless="${#lists.isEmpty(guests)}" class="results-block">...</div>.
What would it take add the same functionality in spark? I'm willing to try it myself but don't know where to start.
When writing AJAX-heavy web pages I'm having to move all my th:fragments into separate HTML files, which breaks one of the benefits of using Thymeleaf and is a lot of effort.
The text was updated successfully, but these errors were encountered:
What would it take add the same functionality in spark? I'm willing to try it myself but don't know where to start.
If this is a thymeleaf-feature you just need to find a way of calling it. You could add an overload, like ThymeleafEngine.render(model, template, fragment)? If it's a Spring feature, you'll have to copy or re-implement the functionality.
Amazing timing @tipsy - I had a flash of inspiration this morning and got it working with the overload mechanism you suggested. Just 5 minutes before your comment!
In Spring/Thymeleaf, it is possible for a controller to ask Thymeleaf to render part of a page declared as a
th:fragment
, e.g.:Where
resultsList
is defined inside a bigger Thymeleaf template as<div th:fragment="resultsList" th:unless="${#lists.isEmpty(guests)}" class="results-block">...</div>
.(As described here and elsewhere).
What would it take add the same functionality in spark? I'm willing to try it myself but don't know where to start.
When writing AJAX-heavy web pages I'm having to move all my
th:fragment
s into separate HTML files, which breaks one of the benefits of using Thymeleaf and is a lot of effort.The text was updated successfully, but these errors were encountered: