0

I'm beginner Developper in OFBiz. i want to process some car data and display theme with freeMarker template.

first i send the carId on click to a screen named carDetail i want then to pass it to a groovy script which will query the database and send back one observation. the observation will be pass to a freeMarker template.

I don't where is the problem. here is the code of the screen.

<screen name="carDetail">
    <section>
        <actions>
            <set field="carId" from-field = "parameters"/>
            <script location="component://ParcAutomobile/groovyScripts/find.groovy"/>
        </actions>
        <widgets>
            <decorator-screen name="ParcAutomobileCommonDecorator" location="${parameters.mainDecoratorLocation}">
                <decorator-section name="body">
                    <platform-specific>
                        <html>
                            <html-template location="component://ParcAutomobile/groovyScripts/list.ftl"></html-template>
                        </html>
                    </platform-specific>
                </decorator-section>
            </decorator-screen> 
        </widgets>
    </section>
</screen>

then i want to get an observation by doing this with groovy.

carId = parameters.carId
context.carId = carId
car = from("Car").where("carId", carId).queryOne()
context.car = car

finally display it in freeMarker template

<div>
<#if car?has_content>
<table>
        <tr>
            <th>${uiLabelMap.CarId}</th>
            <th>${car.carId}</th>
        </tr>
        <tr>
            <th>${uiLabelMap.CarId}</th>
            <th>${car.carId}</th>
        </tr>
</table>
</#if>
</div>

help me fix this.

Koffi5
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 08 '22 at 14:05
  • Do you get any error in the browser (console or page) or in the ofbiz logs ? What's going wrong ? – Florian Motteau Jun 10 '22 at 06:31
  • I do not get any error in the console or in the bowser, a get juste a blank web page. – Koffi5 Jun 11 '22 at 13:23

0 Answers0