Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-12310

Rendering widget screen from ftl with the current context

    XMLWordPrintableJSON

Details

    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>
      

       

       

      Attachments

        1. OFBIZ-12310.patch
          10 kB
          Nicolas Malin

        Activity

          People

            nmalin Nicolas Malin
            nmalin Nicolas Malin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: