Re: Calling #Macro Recursively

Daniel Dekany <[email protected]> Sun, 19 Oct 2014 18:05:25 +0200
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
FTL only sees public members of public classes. Furthermore with it
default configuration it won't try to read fields, only JavaBean
properties. That is, you need getter methods, as usual in Java.


Sunday, October 19, 2014, 5:16:51 PM, firoza wrote:

> Thanks Deniel for your quick response.
> I tired with the approach you suggested but it is not displaying any
> information on the page.
>
> Below is the code snipped:
>
> HierarchyProductSearchResult{
> private Integer chpd;
> private Integer conf;
> private String link;
> private List<String> activeName = Collections.emptyList();
> private List<String> inactiveName= Collections.emptyList();     
> private List<HierarchyProductSearchResult> children =
> Collections.emptyList();
> }
>
> I have a service method which returns list of HierarchyProductSearchResult.
> That list is productSearchResultList.
>
> In ftl I have created the macro and iterating the loop. Blow is the code in
> ftl for macro:
>
> <ul class="accordion">
>                                                          <#macro
> hierarchy productSearchResultList>
>                                                         
>                                                         <#list
> productSearchResultList as productresult>
>                                                         
>                                                         <#assign detailViewPopUp="Y">
>                                                                
> <li>                                                                
>                                                                    
>                                                                    
>                                                                    
> <#if productresult.children?has_content>
>                                                                    
> <@liferay_ui.message key="resultview.hierarchy.click"/>
> <JavaScript:void(0);>  
>                                                                    
>                                                                     </#if>
>                                                                    
>                                                                    
>                                                                    
>                                                                    
> <#include "include/resultRecordDetails.ftl" >
>                                                                    
>                                                                    
> <#if productresult.children?has_content>
>                                                                     <ul>
>                                                                    
>                                                                    
> <@hierarchy productSearchResultList=productresult.children/>
>                                                                     </ul>
>                                                                    
>                                                                    
> </#if>                                                          
>                                                                 
>                                                                 </li>
>                                                                 
>                                                         </#list>
>                                                         </#macro>
>
>
>
> Would you please let me know where I am making the mistake? I got stuck in
> this.
>
> Thanks
>
>
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/Calling-Macro-Recursively-tp626735p4655297.html
> Sent from the freemarker-user mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>

-- 
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho