Hello friends,
I wanted to invoke a method (with parameters) from an ftl file . The method needs to be written in a script file (to separate out presentation from business logic). I have read the ftl manual but it does not have an example of passing arguments to a method which is defined in other script file. What are the possible ways to do this? Regards |
Why not just run the bsh script before the ftl like we do everywhere in
OFBiz? Regards Scott On 08/08/07, vijay Si <[hidden email]> wrote: > > Hello friends, > > I wanted to invoke a method (with parameters) from an ftl file . > > The method needs to be written in a script file (to separate out > presentation from business logic). > > I have read the ftl manual but it does not have an example of passing > arguments to a method which is defined in other script file. > > What are the possible ways to do this? > > Regards > |
Hi Scott,
I will explain the problem in detail. I have a function fnRT(int x1,int x2...........,float xc1,...) The values of x1, x2 ..... will vary scince i will invoke fnRT() MORE Than once with different parameter values. I wanted that each time a fnRt() is invoked in FTL, The method gets invoked in BSH Script which does a necessary calculations and passes out the results as a list to FTL. FTL can then use the results for display. My problem is to handle the runtime parameter passing bsh script and then retrieving it in ftl...............If i run the bsh script before the ftl.........then how am i supposed to get the function parameters in advance... Regards On 8/8/07, Scott Gray <[hidden email]> wrote: > > Why not just run the bsh script before the ftl like we do everywhere in > OFBiz? > > Regards > Scott > > On 08/08/07, vijay Si <[hidden email]> wrote: > > > > Hello friends, > > > > I wanted to invoke a method (with parameters) from an ftl file . > > > > The method needs to be written in a script file (to separate out > > presentation from business logic). > > > > I have read the ftl manual but it does not have an example of passing > > arguments to a method which is defined in other script file. > > > > What are the possible ways to do this? > > > > Regards > > > |
Hi Vijay
Everything that is available to the ftl is available to a bsh script running beforehand, you just need to prepare all your data first then use the ftl to lay it out. Regards Scott On 08/08/07, vijay Si <[hidden email]> wrote: > > Hi Scott, > I will explain the problem in detail. > I have a function fnRT(int x1,int x2...........,float xc1,...) > The values of x1, x2 ..... will vary scince i will invoke fnRT() MORE Than > once with different parameter values. > > I wanted that each time a fnRt() is invoked in FTL, The method > > gets invoked in BSH Script which does a necessary calculations and passes > out the results as a list to FTL. > FTL can then use the results for display. > > My problem is to handle the runtime parameter passing bsh script and then > retrieving it in ftl...............If i run the bsh script before the > ftl.........then how am i supposed to get the function parameters in > advance... > > Regards > > > > > On 8/8/07, Scott Gray <[hidden email]> wrote: > > > > Why not just run the bsh script before the ftl like we do everywhere in > > OFBiz? > > > > Regards > > Scott > > > > On 08/08/07, vijay Si <[hidden email]> wrote: > > > > > > Hello friends, > > > > > > I wanted to invoke a method (with parameters) from an ftl file . > > > > > > The method needs to be written in a script file (to separate out > > > presentation from business logic). > > > > > > I have read the ftl manual but it does not have an example of passing > > > arguments to a method which is defined in other script file. > > > > > > What are the possible ways to do this? > > > > > > Regards > > > > > > |
Other sugestion, call the method from .ftl:
i.e: in .ftl file: <#assign result = Static["package.ClassName"].yourMethod( par1,par2....) > 2007/8/8, Scott Gray <[hidden email]>: > > Hi Vijay > > Everything that is available to the ftl is available to a bsh script > running > beforehand, you just need to prepare all your data first then use the ftl > to > lay it out. > > Regards > Scott > > > On 08/08/07, vijay Si <[hidden email]> wrote: > > > > Hi Scott, > > I will explain the problem in detail. > > I have a function fnRT(int x1,int x2...........,float xc1,...) > > The values of x1, x2 ..... will vary scince i will invoke fnRT() MORE > Than > > once with different parameter values. > > > > I wanted that each time a fnRt() is invoked in FTL, The method > > > > gets invoked in BSH Script which does a necessary calculations and > passes > > out the results as a list to FTL. > > FTL can then use the results for display. > > > > My problem is to handle the runtime parameter passing bsh script and > then > > retrieving it in ftl...............If i run the bsh script before the > > ftl.........then how am i supposed to get the function parameters in > > advance... > > > > Regards > > > > > > > > > > On 8/8/07, Scott Gray <[hidden email]> wrote: > > > > > > Why not just run the bsh script before the ftl like we do everywhere > in > > > OFBiz? > > > > > > Regards > > > Scott > > > > > > On 08/08/07, vijay Si <[hidden email]> wrote: > > > > > > > > Hello friends, > > > > > > > > I wanted to invoke a method (with parameters) from an ftl file . > > > > > > > > The method needs to be written in a script file (to separate out > > > > presentation from business logic). > > > > > > > > I have read the ftl manual but it does not have an example of > passing > > > > arguments to a method which is defined in other script file. > > > > > > > > What are the possible ways to do this? > > > > > > > > Regards > > > > > > > > > > |
I suppose that could work if you can find a way of executing the bsh through
a static call, but for anything other than simple data calls like getNameForParty (i think it's called) it's really not the best way to go. Regards Scott On 09/08/2007, Rodrigo Souza <[hidden email]> wrote: > > Other sugestion, call the method from .ftl: > i.e: > in .ftl file: > > <#assign result = Static["package.ClassName"].yourMethod( par1,par2....) > > > > 2007/8/8, Scott Gray <[hidden email]>: > > > > Hi Vijay > > > > Everything that is available to the ftl is available to a bsh script > > running > > beforehand, you just need to prepare all your data first then use the > ftl > > to > > lay it out. > > > > Regards > > Scott > > > > > > On 08/08/07, vijay Si <[hidden email]> wrote: > > > > > > Hi Scott, > > > I will explain the problem in detail. > > > I have a function fnRT(int x1,int x2...........,float xc1,...) > > > The values of x1, x2 ..... will vary scince i will invoke fnRT() MORE > > Than > > > once with different parameter values. > > > > > > I wanted that each time a fnRt() is invoked in FTL, The method > > > > > > gets invoked in BSH Script which does a necessary calculations and > > passes > > > out the results as a list to FTL. > > > FTL can then use the results for display. > > > > > > My problem is to handle the runtime parameter passing bsh script and > > then > > > retrieving it in ftl...............If i run the bsh script before the > > > ftl.........then how am i supposed to get the function parameters in > > > advance... > > > > > > Regards > > > > > > > > > > > > > > > On 8/8/07, Scott Gray <[hidden email]> wrote: > > > > > > > > Why not just run the bsh script before the ftl like we do everywhere > > in > > > > OFBiz? > > > > > > > > Regards > > > > Scott > > > > > > > > On 08/08/07, vijay Si <[hidden email]> wrote: > > > > > > > > > > Hello friends, > > > > > > > > > > I wanted to invoke a method (with parameters) from an ftl file . > > > > > > > > > > The method needs to be written in a script file (to separate out > > > > > presentation from business logic). > > > > > > > > > > I have read the ftl manual but it does not have an example of > > passing > > > > > arguments to a method which is defined in other script file. > > > > > > > > > > What are the possible ways to do this? > > > > > > > > > > Regards > > > > > > > > > > > > > > > |
Free forum by Nabble | Edit this page |