Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Implemented
-
Trunk
-
None
Description
Currently when you would be rendering a widget screen from a ftl template, you can use a element screen present on context to call the renderer :
${screens.render("component://common/widget/CommonScreens.xml#countries")}
This rendering is realized with the context present when the object screen has been initialized.
To simplify the screen call from freemarker template, I implemented a new macro ofbizScreen
You can call a Ofbiz screen with the ftl context with simple macro
<@ofbizScreen>component://mycomponent/widget/MyComponentScreens.xml#MyScreen</@ofbizScreen>
You can also write
<@ofbizScreen location="component://mycomponent/widget/MyComponentScreens.xml" name="MyScreen"/>
Or set a default location on your context
action :
context.defaultTemplateLocation = "component://mycomponent/widget/MyComponentScreens.xml"
widget :
<@ofbizScreen>MyScreen</@ofbizScreen>
When the screen would be call, the context to rendering the screen would be use the current context:
<#list contactMechs as contactMech>
<#assign contactMechId = contactMech.contachMechId/>
<@ofbizScreen>component://mycomponent/widget/MyComponentScreens.xml#DisplayContactMech</@ofbizScreen>
</#list>