Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Step - 1 : Now its the time to create a decorator for the screens in this application so for that create a file by name CommonScreens.xml file in "widget" directory. This file will be containing the common screens which will be used through out the whole application. E.g. A common screen may have header and footer included in it so which ever is the screen will be using it as a decorator will be having those in common. For this you can take reference from CommonScreens.xml file of "example" component.

CommonScreens.xml file code will be:

Code Block

 <screen name="CommonPracticeDecorator">
      <section>
          <widgets>
              <decorator-screen name="main-decorator">
                  <decorator-section name="body">
                      <decorator-section-include name="body"/>                     
                  </decorator-section>
              </decorator-screen>
          </widgets>
      </section>
</screen>

and for main-decorator refer "Example" component.
An important reading at this moment is at Understanding the OFBiz Widget Toolkit another is the FAQ in this you can read the contents under heading  "The Decorator".
Step - 2 : Create a menu for this application. For this create a file by name PracticeMenus.xml in "widget" directory of you component. For this take a reference from ExampleMenus.xml file of "example" component.

...

PracticeScreens.xml new screen entry will be:

Code Block
    <screen name="person">
        <section>
            <actions>
                <script location="component://practice/webapp/practice/WEB-INF/actions/Person.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonPracticeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <platform-specific>
                            <html>
                                <html-template location="component://practice/webapp/practice/Person.ftl"/>
                            </html>
                        </platform-specific>
                    </decorator-section>
                </decorator-screen>       
            </widgets>
        </section>
    </screen>

...