You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Arun Patidar <ar...@hotwaxmedia.com> on 2009/03/20 07:17:51 UTC

delegator.finlist method doesn't work in ftl

Hello all,

When I try to access this request 
https://localhost:8443/projectmgr/control/EditProjectSkills, getting error.
IMO this is because we can not use delegator.findList method in ftl.
This has been used like this: <#assign skillTypes = 
delegator.findList("SkillType", null, null, null, null, false)>
If I use it like <#assign skillTypes = delegator.findList("SkillType", 
NULL, NULL, NULL, NULL, false)>  then it works fine.
Do we need to change something at framework level.

Here is the log:

Method public java.util.List 
org.ofbiz.entity.GenericDelegator.findList(java.lang.String,org.ofbiz.entity.condition.EntityCondition,java.util.Set,java.util.List,org.ofbiz.entity.util.EntityFindOptions,boolean) 
throws org.ofbiz.entity.GenericEntityException threw an exception when 
invoked on org.ofbiz.entity.GenericDelegator@10b51f4 The problematic 
instruction: ---------- ==> assignment: 
skillTypes=delegator.findList("SkillType", null, null, null, null, 
false) [on line 36, column 13 in 
component://projectmgr/webapp/projectmgr/project/editProjectskills.ftl] 
---------- Java backtrace for programmers: ---------- 
freemarker.template.TemplateModelException: Method public java.util.List 
org.ofbiz.entity.GenericDelegator.findList(java.lang.String,org.ofbiz.entity.condition.EntityCondition,java.util.Set,java.util.List,org.ofbiz.entity.util.EntityFindOptions,boolean) 
throws org.ofbiz.entity.GenericEntityException threw an exception when 
invoked on org.ofbiz.entity.GenericDelegator@10b51f4 at 
freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130) 
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93) at 
freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at 
freemarker.core.Assignment.accept(Assignment.java:90) at 
freemarker.core.Environment.visit(Environment.java:209) at 
freemarker.core.MixedContent.accept(MixedContent.java:92) at 
freemarker.core.Environment.visit(Environment.java:209) at 
freemarker.core.Environment.process(Environment.java:189) at


Please correct me if I am wrong.

Thanks & Regards
--
Arun Patidar

Re: delegator.finlist method doesn't work in ftl

Posted by David E Jones <da...@hotwaxmedia.com>.
Why are you calling it in the FTL file and not in an action in the  
screen definition (the normal place to do data preparation, FTL is  
just for layout of prepared data).

-David


On Mar 20, 2009, at 12:17 AM, Arun Patidar wrote:

> Hello all,
>
> When I try to access this request https://localhost:8443/projectmgr/control/EditProjectSkills 
> , getting error.
> IMO this is because we can not use delegator.findList method in ftl.
> This has been used like this: <#assign skillTypes =  
> delegator.findList("SkillType", null, null, null, null, false)>
> If I use it like <#assign skillTypes =  
> delegator.findList("SkillType", NULL, NULL, NULL, NULL, false)>   
> then it works fine.
> Do we need to change something at framework level.
>
> Here is the log:
>
> Method public java.util.List  
> org 
> .ofbiz 
> .entity 
> .GenericDelegator 
> .findList 
> (java 
> .lang 
> .String 
> ,org 
> .ofbiz 
> .entity 
> .condition 
> .EntityCondition 
> ,java 
> .util 
> .Set,java.util.List,org.ofbiz.entity.util.EntityFindOptions,boolean)  
> throws org.ofbiz.entity.GenericEntityException threw an exception  
> when invoked on org.ofbiz.entity.GenericDelegator@10b51f4 The  
> problematic instruction: ---------- ==> assignment:  
> skillTypes=delegator.findList("SkillType", null, null, null, null,  
> false) [on line 36, column 13 in component://projectmgr/webapp/ 
> projectmgr/project/editProjectskills.ftl] ---------- Java backtrace  
> for programmers: ----------  
> freemarker.template.TemplateModelException: Method public  
> java.util.List  
> org 
> .ofbiz 
> .entity 
> .GenericDelegator 
> .findList 
> (java 
> .lang 
> .String 
> ,org 
> .ofbiz 
> .entity 
> .condition 
> .EntityCondition 
> ,java 
> .util 
> .Set,java.util.List,org.ofbiz.entity.util.EntityFindOptions,boolean)  
> throws org.ofbiz.entity.GenericEntityException threw an exception  
> when invoked on org.ofbiz.entity.GenericDelegator@10b51f4 at  
> freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java: 
> 130) at  
> freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)  
> at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)  
> at freemarker.core.Assignment.accept(Assignment.java:90) at  
> freemarker.core.Environment.visit(Environment.java:209) at  
> freemarker.core.MixedContent.accept(MixedContent.java:92) at  
> freemarker.core.Environment.visit(Environment.java:209) at  
> freemarker.core.Environment.process(Environment.java:189) at
>
>
> Please correct me if I am wrong.
>
> Thanks & Regards
> --
> Arun Patidar