[
https://issues.apache.org/jira/browse/OFBIZ-12310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17409670#comment-17409670
]
ASF subversion and git services commented on OFBIZ-12310:
---------------------------------------------------------
Commit a83faaf15af5054d6a8997b8b6810aa4da49b504 in ofbiz-framework's branch
refs/heads/trunk from Nicolas Malin
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=a83faaf ]
Fixed: Rendering widget screen from ftl with the current context : java doc
generation error (OFBIZ-12310)
Correction previous commit with invalid character on the javadoc.
> Rendering widget screen from ftl with the current context
> ---------------------------------------------------------
>
> Key: OFBIZ-12310
> URL: https://issues.apache.org/jira/browse/OFBIZ-12310
> Project: OFBiz
> Issue Type: Improvement
> Components: framework/widget
> Affects Versions: Trunk
> Reporter: Nicolas Malin
> Assignee: Nicolas Malin
> Priority: Minor
> Labels: ftl, macro, rendering, screen
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-12310.patch
>
>
> 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 :
> {code:java}
> ${screens.render("component://common/widget/CommonScreens.xml#countries")}
> {code}
> 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
> {code:java}
> <@ofbizScreen>component://mycomponent/widget/MyComponentScreens.xml#MyScreen</@ofbizScreen>{code}
> You can also write
> {code:java}
> <@ofbizScreen
> location="component://mycomponent/widget/MyComponentScreens.xml"
> name="MyScreen"/>{code}
> Or set a default location on your context
> action :
> {code:java}
> context.defaultTemplateLocation =
> "component://mycomponent/widget/MyComponentScreens.xml"{code}
> widget :
> {code:java}
> <@ofbizScreen>MyScreen</@ofbizScreen>{code}
> When the screen would be call, the context to rendering the screen would be
> use the current context:
> {code:java}
> <#list contactMechs as contactMech>
> <#assign contactMechId = contactMech.contachMechId/>
>
> <@ofbizScreen>component://mycomponent/widget/MyComponentScreens.xml#DisplayContactMech</@ofbizScreen>
> </#list>
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)