You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ramkrishna Swamy <ra...@gmail.com> on 2014/05/14 11:22:14 UTC

Non static java method call in ftl

Hi User,

Is there any way to call non static java method in ftl?


-- 
Thanks
Ramkrishna

Re: Non static java method call in ftl

Posted by Ramkrishna Swamy <ra...@gmail.com>.
Thank you Youssef for the pointer.



On Wednesday, May 14, 2014, Youssef Khaye <y....@unionsmarket.com> wrote:

> In general, to call a non static java method you should have an instance
> from its class.
> for example
> ${screens.render("component://common/widget/CommonScreens.xml#cctypes")}
> in our context  we have an object called "screens"  wich is an instance of
> ScreenRenderer class.
> with that object we can call non static method  render:
> public String render(String combinedName)
> hope this help.
>
> youssef.
>
> Le 14/05/2014 11:22, Ramkrishna Swamy a écrit :
>
>> Hi User,
>>
>> Is there any way to call non static java method in ftl?
>>
>>
>>
>

Re: Non static java method call in ftl

Posted by Youssef Khaye <y....@unionsmarket.com>.
In general, to call a non static java method you should have an instance 
from its class.
for example
${screens.render("component://common/widget/CommonScreens.xml#cctypes")}
in our context  we have an object called "screens"  wich is an instance 
of ScreenRenderer class.
with that object we can call non static method  render:
public String render(String combinedName)
hope this help.

youssef.

Le 14/05/2014 11:22, Ramkrishna Swamy a écrit :
> Hi User,
>
> Is there any way to call non static java method in ftl?
>
>