Ah ok, so you mean that you have a form generated from an ftl and when that
form is submitted you can't get the parameters using request.getAttribute
("jrParameters")?  Try using request.getParameter("jrParameters").
Usually when people talk about trying to do things from ftl they are talking
about while rendering the template.

Regards
Scott

2008/12/3 Hari Plaikoil <[EMAIL PROTECTED]>

>
> I need to go to .ftl after visit the .bsh because I have to choose an
> printer
> name, report type for my other parameters for the java's event. and the
> choices are in .ftl (drop-down) :-D
>
> you can say I take a long path just to make a pdf's report :-D frankly, I
> don't know how to explain that.
>
> So, would you like to help me how to pass the parameters (Map's type &
> JRDataSource's type) from .ftl to java's event?
>
> Anyway, I write piece of code on java's event to catch the parameters like
> this :
>
>        Map<String, Object> jPrm =
> (Map)request.getAttribute("jrParameters");
>         JRDataSource jrDataSource = (JRDataSource)
> request.getAttribute("jrDataSource");
>
>     but, the variables give me null value :-((
>
>
>
> Scott Gray wrote:
> >
> > Why are you waiting until you get to the template?  Wouldn't it be easier
> > to
> > call the method from the bsh script?
> > Regards
> > Scott
> >
> > 2008/12/3 Hari Plaikoil <[EMAIL PROTECTED]>
> >
> >>
> >> I followed your instruction. First, I've got the jrParameters (Map's
> >> type)
> >> and jrDataSource (JRDataSource's type) as output parameters from java
> >> service. Second, I catch the parameters on .bsh file, I put the
> >> parameters
> >> on context than I pass to .ftl
> >> Third, on .ftl, I've checked both of the parameters, they have the same
> >> data
> >> like in .bsh file.
> >> Fourth, I called java's event from .ftl through controller. On the
> java's
> >> event I realized the value of jrParameters and jrDataSource are null.
> >>
> >> I really don't have any idea how to set  fields or parameters for both
> of
> >> them on .ftl so when I catch on java's event the value will not null. I
> >> tried on .ftl assign the parameters like the code below:
> >>
> >>  <@inputHidden name="jrParameters" value="${jrParameters}"/>
> >>  <@inputHidden name="jrDataSource" value="${jrDataSource}"/>
> >>
> >>  the code causes error exception, so I changed to :
> >>
> >>  <#assign jrParameters = "${jrParameters}">
> >>  <#assign jrDataSource = "${jrDataSource}">
> >>
> >>  again, it causes an error exception too :-((
> >>
> >>  Please, help me out....
> >>
> >>  Thanks.
> >>
> >>
> >> BJ Freeman wrote:
> >> >
> >> > in ofbiz you pass the ftl thru the controller to a request-map
> >> > if you need to process the data then you can all a service or event.
> >> > if you use a service then the data is availible as a context.
> >> > if you use an event it is availible thru the httprequest.
> >> > otherwise you can direct to another page through a view that would be
> >> > your report.
> >> > if your using widgets you can process data in the action section then
> >> > define the ftl that will show the report.
> >> >
> >> > ofbiz takes care of passing the information.
> >> >
> >> > review
> >> >
> >>
> http://docs.ofbiz.org/display/OFBIZ/OFBiz+Beginner%27s+Development+Guide+Using+Practice+Application
> >> .
> >> >
> >> >
> >> >
> >> > Hari Plaikoil sent the following on 12/2/2008 3:15 AM:
> >> >> Dear all,
> >> >>
> >> >> Could you tell me how to pass a Map's parameter from ftl to java?
> >> >>
> >> >> When in ftl, the parameter has data. But when I call it in java's
> >> method
> >> >> by
> >> >> this code below, I got null value:
> >> >>
> >> >>  Map<String, Object> jPrm = (Map<String,
> >> >> Object>)request.getAttribute("jrParameters");
> >> >>  JRDataSource jrDataSource = (JRDataSource)
> >> >> request.getAttribute("jrDataSource");
> >> >>
> >> >>  In this case, I want to pass jrParameter and jrDatasource to make a
> >> >> report.
> >> >>
> >> >> Please, help me...
> >> >>
> >> >> Thanks.
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/passing-map-parameter-from-ftl-to-event-type-java-tp20790183p20805691.html
> >> Sent from the OFBiz - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/passing-map-parameter-from-ftl-to-event-type-java-tp20790183p20805941.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>

Reply via email to