thymeleaf 3 issue with nested lists//nested maps?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

thymeleaf 3 issue with nested lists//nested maps?

basically asking thymeleaf to "iterate" the map.value for each entry, I get an error complaining that "value" cannot be found on null.. If i use thymeleaf2.X this works perfectly though.. Then I assumed that something might have broken the "cast" from map.entry to a proper list.. I changed the code to be a List aBean with ContainerBean having a string tagAreaName and a List tiedValues adapted the html code
<tr th:each="instance,itr : ${aBean}">
	<td th:text="${instance.tagAreaName}" colspan="4" style="font-weight:bold">tagareaName</td>
	<tr th:unless="${instance == null}" th:each="ad : ${instance.tiedValues}">  
	<td th:text="${instance.tagAreaName}" colspan="4" style="font-weight:bold">tagareaName</td>                    								        	
        <td th:title="${ad.documentName}" th:text="${#strings.abbreviate(ad.documentName,90)}"></td>
        <td th:text="${ad.fileSubmitDate}"></td>							        
        <td style="text-align: center; vertical-align: middle;">
		    <a href="#" th:href="@{'/link/customDocumentation/detail?id=' + ${ad.id}}">
		    	<img style="vertical-align: baseline;" width="15" height="15" class="edit-user cursor-pointer" th:src="@{/img/glyphicons_150_edit.png}" />								    									
		    </a>								       	
        </td>	
	</tr>	
</tr>
and I receive the very same error now associated to "tiedFiles" attribute not being found on null (instance null) which shouldn't be possible in the first place given the th:unless="${instance == null}" I am at my wits end.. Did the nested loops behaviour change in thymeleaf 3? Because this was fully functional as of thymeleaf2... :/ Thanks in advance
witchedwiz
Hi all, I'm facing a curious problem.. given Map<String, List<ACertainBean>> aMap the following would work in thymeleaf2.X
<tr th:each="instance : ${aMap}">
	<td th:text="${instance.key}" colspan="4" style="font-weight:bold">keyvalue</td>
	<tr th:each="ad : ${instance.value}">
		<td></td>	                        								        	
        <td th:title="${ad.documentName}" th:text="${#strings.abbreviate(ad.documentName,90)}"></td>
        <td th:text="${ad.fileSubmitDate}"></td>							        
        <td style="text-align: center; vertical-align: middle;">
		    <a href="#" th:href="@{'/link/customDocumentation/detail?id=' + ${ad.id}}">
		    	<img style="vertical-align: baseline;" width="15" height="15" class="edit-user cursor-pointer" th:src="@{/img/glyphicons_150_edit.png}" />								    									
		    </a>								       	
        </td>	
	</tr>
</tr>
as of thymeleaf3, this seems not to be working anymore, and literally when cycling
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: thymeleaf 3 issue with nested lists//nested maps?

witchedwiz
anyone?
please note that the above post got "broken" by some stuff on the forum side..
instead of being
"Hi all, I'm facing a curious problem.. given Map<String, List<ACertainBean>> aMap the following would work in thymeleaf2.X
blablablalbalbalal
blalblalalblala2"
it's being presented as
"blalblalalblala2
Hi all, I'm facing a curious problem.. given Map<String, List<ACertainBean>> aMap the following would work in thymeleaf2.X
blablablalbalbalal"

oh well :X
Loading...