OFBiz Tree widgets

OFBiz Tree widgets are widgets that automatically generate HTML unordered lists (HTML ul and li markup tags) from the specified database content and/or other XML declarations.

Tree widgets are defined in Tree widget definition files that have an XML XSD declaration as follows. Tree widget definition files may be located anywhere within an OFBiz install:

<trees xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://ofbiz.apache.org/dtds/widget-tree.xsd">
</trees>

How to do it...

Tree widgets can be added by the following steps:

  1. Create a Tree widget definition within an existing Tree widget definition file. Start with a tree name and a root-node-name attribute. The root-node-name is a trigger to OFBiz to create an HTML ul markup tag.
  2. Create one or more "nodes". A tree node is created when you specify a node element.
  3. Create one or more "sub-nodes".
  4. Close all node and sub-node elements.
  5. Save the file.
  6. Add the Tree widget to an existing Screen widget definition. For example,<include-tree name="MyTree" />

How it works...

Tree widgets create HTML by taking the XML widget declarations and merging those declarations with any specified database values to create the corresponding HTML. Tree widgets build one or more HTML unordered lists (ul) with associated list tags, HTML styling, and hyperlinks. For example:

Basic tree

 

XML

<tree name="mytree" root-node-name="first-node" >

<node name="first-node">

</node>

</tree>

HTML

<ul class="basic-tree">

<li>

<a class="leafnode"> </a>

</li>

</ul>

There's more...

For example, the following screenshot shows a browser web page built from a single OFBiz Screen widget, decorator-screen, a single embedded Tree widget, and a single embedded FreeMarker template:

There's more...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.9.197