public final class Foo {
private final String name;
private final Integer quantity;
public Foo(final String name, final Integer quantity) {
this.name = name;
this.quantity = quantity;
}
public String getName() { return name; }
public Integer getQuantity() { return quantity; }
}
Basically, I want blocks like |q1=42 displayed only when quantity is not null. Unfortunately, {{-index}} is only set to the correct element index if used directly inside the {{#fooList}} list block; it is 0 when used inside the condition block, so the expression evaluates to something like |q0=42.
I think that the behavior of {{-index}} should be changed to refer to the index corresponding to the innermost list block. It should only be 0 if the statement is being evaluated outside of any list block whatsoever.
I have a class like this:
and I have a template block like this:
Basically, I want blocks like
|q1=42
displayed only when quantity is not null. Unfortunately,{{-index}}
is only set to the correct element index if used directly inside the{{#fooList}}
list block; it is 0 when used inside the condition block, so the expression evaluates to something like|q0=42
.I think that the behavior of
{{-index}}
should be changed to refer to the index corresponding to the innermost list block. It should only be 0 if the statement is being evaluated outside of any list block whatsoever.