tim
2015-02-11 15:49:04 UTC
Hi,
I have a data model of this kind:
contract
+contractParties
+contractParty
++share
+++amount
+++currency
...
I want to display amount and share for each contract party:
<#list contract[0].contractParties.contractParty as p>
Amount: ${p.share.amount!}
Share: ${p.share.currency!}
</#list>
list creates a sequence and that's fine. If there is no contract party, this
will just be omitted -> fine.
But then I want to access amount anf currency of the share. This works if
there is a share. It does not work if there is no share, though. If share is
null/empty/missing, it creates an error no matter what I do. I tried
${p.share[0].currency!} and ${p.share[0]!.currency!}, but it does not work
if share is undefined.
Is it possible to either
- turn off error handling for missing data model fractions or
- ignore missing paths
?
Thanks for your feedback!
--
View this message in context: http://freemarker.624813.n4.nabble.com/Handling-of-optional-data-tree-tp4655366.html
Sent from the freemarker-user mailing list archive at Nabble.com.
I have a data model of this kind:
contract
+contractParties
+contractParty
++share
+++amount
+++currency
...
I want to display amount and share for each contract party:
<#list contract[0].contractParties.contractParty as p>
Amount: ${p.share.amount!}
Share: ${p.share.currency!}
</#list>
list creates a sequence and that's fine. If there is no contract party, this
will just be omitted -> fine.
But then I want to access amount anf currency of the share. This works if
there is a share. It does not work if there is no share, though. If share is
null/empty/missing, it creates an error no matter what I do. I tried
${p.share[0].currency!} and ${p.share[0]!.currency!}, but it does not work
if share is undefined.
Is it possible to either
- turn off error handling for missing data model fractions or
- ignore missing paths
?
Thanks for your feedback!
--
View this message in context: http://freemarker.624813.n4.nabble.com/Handling-of-optional-data-tree-tp4655366.html
Sent from the freemarker-user mailing list archive at Nabble.com.