Closed dudabone closed 8 years ago
Sorry, correction - this happens because the values of the map are of custom class of ours: SourceResult <K, V>. In this case, K is of type Long, and this is where the exception is thrown (EachHelper.java:89):
String key = entry.getKey();
Is there anything to do in order to support this or must I change it to SourceResult<String, String>?
Ok, just noticed that this issue was fixed in https://github.com/jknack/handlebars.java/commit/9809123b33cf894da84bdebbfa94f39b0bc5736d.
Amazing :)
closing the issue
Not sure that this is a bug - but when passing a Map<Long, V> in the context and iterating with {{#each}}, I get the following exception:
om.github.jknack.handlebars.HandlebarsException: /resources/app/templates/forms/bindable-controls/bindable-single-select.hbs:4:11: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String /resources/app/templates/forms/bindable-controls/bindable-single-select.hbs:4:11 at com.github.jknack.handlebars.helper.EachHelper.apply(EachHelper.java:89) at com.github.jknack.handlebars.internal.Block.merge(Block.java:211) at com.github.jknack.handlebars.internal.BaseTemplate.apply(BaseTemplate.java:128) at com.github.jknack.handlebars.internal.TemplateList.merge(TemplateList.java:94) at com.github.jknack.handlebars.internal.BaseTemplate.apply(BaseTemplate.java:128)
Is it supposed to be like this? are map keys limited only to Strings?