Matt,

That seems to have been the issue.  I am surprised that it was null, since I 
had converted the same method to return a String, and everything was working 
(and displaying content).

Thanks
Rakesh


On 30/06/2010 11:15, "Dertinger, Matthew" <[email protected]> wrote:



Rakesh,

Judging by the description of the freemarker exception (xxx?size not
available), it could be that your collection is null, so when you call the
?size built in on it Freemarker throws an exception.  To test my hypothesis,
try adding the default value operator (the ! character) after your
collection, thus replacing xxx?size with xxx!?size and see if it still
throws the exception. If it doesn't then there's a good chance that your
collection is null.

For more info on this and different approaches to handling null objects,
check out the documentation for the has_content built-in here:
http://freemarker.sourceforge.net/docs/ref_builtins_expert.html#ref_builtin_
has_content

You can also have a look at handling missing values and the default value
operator documentation here:
http://freemarker.sourceforge.net/docs/dgui_template_exp.html#dgui_template_
exp_missing

HTH,
Matt




From: Jan Haderka <[email protected]>
Reply-To: Magnolia User-List <[email protected]>
Date: Wed, 30 Jun 2010 16:45:49 +0200
To: Magnolia User-List <[email protected]>
Subject: Re: [magnolia-user]  Use standard FTL directives on page?

You should be able to iterate over the list just fine in freemarker. You
might want to check their documentation if you are not sure about the
syntax.
If you are sure that the syntax is fine, please postthe snippet of the code
causing the problem and full exception message and stacktrace to
pastebin.com <http://pastebin.com>  or similar service and post here the
link to it.
Jan

On Jun 30, 2010, at 4:16 PM, Rakesh Vidyadharan wrote:

> How can I access standard directives (or commands or whatever they are called
> such as list) on a "Page" in the admin interface.  I have my sub-class of
> TemplatedMVCHandler as the backing bean etc., but when I attempted to access a
> Collection and iterate from the page, I got a Freemarker exception related to
> xxx?size not available or something like that.  I went back to generating the
> output from the handler, so do not have the full stack trace handy (but I can
> reproduce it if that helps).  It would be much simpler and more elegant to
> have FTL take care of the iteration than doing it in Java.
>
> Thanks
> Rakesh
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------





----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to