Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: More Minor corrections for clarity and conciseness

...

Step - 9 : Now that we have the basic elements in place lets let's review the basic flow no matter how large or complex your component gets. First, a request will be made by a browser to see a specific resource. Take for example the request: "localhost:8080/practice/control/main"

...

Start the server by typing the following at the command line : java -Xmx256M -jar ofbiz.jar (the -Xmx256M command just ensures that the program has enough memory) Then, hit the url http://localhost:8080/practice/control/main in your browser.  Your browser should show "This is first practice" as seen below.

...

Doing some advancements :

Step - 1 : Now its the time Now it is time to create a decorator for the screens in this application so for that create . Create a file by name named CommonScreens.xml file in the "widget" directory. This file will be containing contain the common screens which will be used through out the whole application. E.gthroughout the entire application. A common screen may have a header and footer included in it so which ever is the screen will be using it as a decorator will be having those in commonso any other screens that use it as a decorator will also have those items. For this you can take reference from the CommonScreens.xml file of file in the "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 Refer to the "CommonScreens.xml" file in the "Example" component .
An important reading to see usage of main-decorator.  Two important readings at this moment is at are Understanding the OFBiz Widget Toolkit another is the FAQ in this you can read the contents under heading  and "The Decorator" section in FAQ.

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.

...