-
Book Overview & Buying
-
Table Of Contents
Apache OfBiz Cookbook
It is possible to pass context information, such as the name of a screen, to a FreeMarker template and/or a Groovy script directly from the Screen widget definition.
Context information can be passed to FreeMarker in the following way:
1. Under the actions element within a Screen widget definition, add one/more set elements with the field attribute set to the name of the variable and the value attribute set to the value of the variable.
2. Retrieve this variable using the name specified in step 1.
Setting field values using the earlier method places the named variable with its value within the execution context. Once in the context, the FreeMarker rendering engine and any other screen rendering artifact, including any OFBiz widget, has access to it.
For example, to add an action to set a context variable named myScreenVariable, you might code something like the following:
<actions> <set field="myScreenVariable...
Change the font size
Change margin width
Change background colour