This is the correct mailing list for this discussion. The dev list is for discussions about the
development of OFBiz itself, not end-user modifications. It might be a good idea to start a new
thread though.
I don't use the eCommerce component, so I can't help you with this question. Maybe someone else can
chime in.
-Adrian
Vince Clark wrote:
Thanks. That is so simple and clears up my confusion.
This thread should probably be in the dev forum at this point, but I'll
continue here.
Can you provide some clarity on how to get the information I want? For
example, if I want a screenlet with all "Brands" listed so I can click
on one and get all products of that brand?
I see two classes available under org.ofbiz.product.feature
ParametricSearch.java
ProductFeatureServices.java
ParametricSearch.java has a method called getAllFeaturesByType. Sure
sounds like what I need. It accepts a GenericDelegator. I haven't
explored this code yet but I assume it would be used in the following
fashion:
Use beanshell to instantiate a GenericDelegator, store the featureTypeId
in it somehow, then call the service.
Use context.put to store the results in the bsh context so the ftl can
access.
Adrian Crum wrote:
Vince Clark wrote:
That's the basics. Now to the next step, customizing the information in
the screenlets. This is where I am stuck. As far as I can tell the
process is basically to execute the bean shell (bsh file) defined in the
<action> tag of the screen definition. This interacts with the service
layer and puts information in the request object so it is accessible to
the ftl file for rendering.
I am struggling with understanding how beanshell puts the data in the
request. I see "context.put" and assume it happens here. I am also
struggling with what classes to use to get the information I need, and
how to pass these classes constraints to limit the result.
The beanshell context object is basically a HashMap that is passed to
Freemarker. So anything you "put" in the beanshell context is
available to "get" in Freemarker (or screen widgets).
In bsh:
context.put("MyMessage", "Hello World!");
In ftl:
<h1>${MyMessage}</h1>