Re: No other way of handling missing values?

Daniel Dekany <[email protected]> Fri, 13 Feb 2015 20:45:58 +0100
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
If only the last step in the chain can be missing (`perProductYn`),
then you don't need all that (...). And as Andy said, you could use
`exp!default == exp`. You can also use `exp! == exp` as `"" != "Y"`.
So at the end you end up with:

  <#if c.royaltyTerms.OffsetLimit.perProductYn! == "Y">


Friday, February 13, 2015, 1:16:27 PM, tim wrote:

> I am checking on a flag that sometimes is missing/NULL and sometimes it
> exists in the model but is false.
>
> The only way to securely check on the flag I found is:
>
> <#if (c.royaltyTerms.OffsetLimit.perProductYn)??> (see if it is NULL)
> <#if (c.royaltyTerms.OffsetLimit.perProductYn=="Y")> (see if is true/set)
>
> Is there no better way? I appreciate the possibility of differentiating
> between NULL and existing, but it is only very rare cases in which such a
> check is required. In 90% of the cases you want a missing value be treated
> as an existing but not matching value... In the freemarker docs it says that
> Freemarker is picky about NULL values in its standard configuration. But I
> found no configuration to change this behavior. Is there any?
>
> Cheers,
> Tim
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/No-other-way-of-handling-missing-values-tp4655373.html
> Sent from the freemarker-user mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>

-- 
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/