Versions Compared

Key

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

Developing the View layer

In CRM.COM software, we use a mechanism embedded in our framework to dynamically generate the HTML code of the pages, the Page Generator.

...

Using a description language

...

we define the components and the layout of the pages which is in XML format. These XML files are parsed by the Page Generator to generate the HTML code and return it to the browser that issued the request.

...

The main types of pages we use in the software are three:

...

Summary Pages

Summary pages are used to display multiple records in a tabular form. They give the ability to the user to search for a specific record in the database by specifying a set of criteria.

Image Removed

The user is also able to setup his summary page by specifying a number of other parameters such as the fields that are displayed on the summary page, how the records are ordered, which filters are visible , etc...

Image Removed

In this tutorial, we are going to create a summary page that lists Installed Item Types.

Creating the Summary Page XML

To create a new summary page, we need to create a single .xml file that will define our summary page.

Before proceeding with the creation of the summary page, it is required that you read the summary page documentation found here.

The first thing to do is to create a .xml file located in ../summary/modulename directory.

In this case, following the Getting Started: User Interface, we create a directory named ../summary/inventory and then we create a new XML file named installedItemTypeSummary.xml as follows.

Image Removed

 

Code Block
languagehtml/xml
titleInstalled Item Type Summary Page XML
firstline1
linenumberstrue
<summary>
    <title>Installed Item Types</title>
     <sql>FROM INSTALLEDITEMTYPES
         LEFT OUTER JOIN PRODUCTS ON PRODUCTS.ProdID=INSTALLEDITEMTYPES.ProdID
         LEFT OUTER JOIN PRODUCTTYPES ON PRODUCTTYPES.ProdTypeID=INSTALLEDITEMTYPES.ProdTypeID 
         LEFT OUTER JOIN USERS CREATEDBY ON CREATEDBY.UserID=INSTALLEDITEMTYPES.InstItemTypeCreatedByUserID
        LEFT OUTER JOIN USERS UPDATEDBY ON UPDATEDBY.UserID=INSTALLEDITEMTYPES.InstItemTypeUpdatedByUserID 
        WHERE INSTALLEDITEMTYPES.INSTITEMTYPEDELETED=0
         %filter% %groupby%
    </sql>
    <rowsperpage>100</rowsperpage>
    <primaryfield>INSTALLEDITEMTYPES.InstItemTypeID</primaryfield>
    <mainlinkfield>INSTALLEDITEMTYPES.InstItemTypeID</mainlinkfield>
    <groupby></groupby>
    <autosearch>true</autosearch>
    <hidefindbutton>false</hidefindbutton>
    <multiselect>false</multiselect>
    <userviewfilter></userviewfilter>
    
    <fieldlist>
        <field>
            <fieldname>INSTALLEDITEMTYPES.InstItemTypeName</fieldname>
            <caption>Name</caption>
            <summary>true</summary>
            <filter>true</filter>
            <fieldtype>string</fieldtype>
            <link>page.do?xml=inventory/installedItemTypeDetailBody&amp;act=itm&amp;fc=loadForm&amp;jndi=ejb/CRMUIInstalledItemType&amp;pv0=((INSTALLEDITEMTYPES.InstItemTypeID))&amp;pvc=1</link>
        </field>
        
        <field>
            <fieldname>INSTALLEDITEMTYPES.InstItemTypeAltCode</fieldname>
            <caption>Alternative Code</caption>
            <summary>true</summary>
            <filter>true</filter>
            <mouseover>false</mouseover>
            <expand>false</expand>
        </field>
        
        <field>
            <fieldname>INSTALLEDITEMTYPES.InstItemTypeDesc</fieldname>
            <caption>Description</caption>
            <summary>true</summary>
            <filter>false</filter>
            <mouseover>false</mouseover>
            <expand>false</expand>
        </field>
        
        <field>
            <fieldname>IsDefault</fieldname>
            <fieldfunction>INSTALLEDITEMTYPES.InstItemTypeDefault</fieldfunction>
            <caption>Is Default</caption>
            <fixedlookup>ejb/CRMUIInstalledItemType.getYesNoSelectBox</fixedlookup>
            <filter>true</filter>
            <filteronexpand>true</filteronexpand>
        </field>
        
        <field>
            <fieldname>IsTraceable</fieldname>
            <fieldfunction>INSTALLEDITEMTYPES.InstItemTypeIsTraceable</fieldfunction>
            <caption>Is Traceable</caption>
            <fixedlookup>ejb/CRMUIInstalledItemType.getYesNoSelectBox</fixedlookup>
            <filter>true</filter>
        </field>
        
        <field>
            <fieldname>INSTALLEDITEMTYPES.InstItemTypeDefault</fieldname>
            <caption>Is Default</caption>
            <fixedlookup>ejb/CRMUIInstalledItemType.getYesNoLookup</fixedlookup>
            <summary>true</summary>
        </field>
        
        <field>
            <fieldname>INSTALLEDITEMTYPES.InstItemTypeIsTraceable</fieldname>
            <caption>Is Traceable</caption>
            <fixedlookup>ejb/CRMUIInstalledItemType.getYesNoLookup</fixedlookup>
            <summary>true</summary>
        </field>
           <field>
               <fieldname>PRODUCTS.ProdID</fieldname>
               <caption>Product</caption>
            <filter>true</filter>
            <filteronexpand>true</filteronexpand>
            <filterlookupname>dataset;products.getproducts;prodid;prodnum</filterlookupname>
            <summary>false</summary>
           </field>
           
            <field>
               <fieldname>PRODUCTTYPES.ProdTypeID</fieldname>
               <caption>Product Type</caption>
            <filter>true</filter>
            <filteronexpand>true</filteronexpand>
            <filterlookupname>dataset;products.getproducttypes;prodtypeid;prodtypename</filterlookupname>
            <summary>false</summary>
           </field>
        <field>
            <fieldname>PRODUCTS.ProdNum</fieldname>
               <caption>Product No.</caption>
               <summary>true</summary>
               <expand>false</expand>    
           </field>
           
           <field>
            <fieldname>PRODUCTTYPES.ProdTypeName</fieldname>
               <caption>Product Type Name</caption>
               <summary>true</summary>
               <expand>false</expand>    
           </field>   
        <field>
            <fieldname>CREATEDBY.USERNAME</fieldname>
            <caption>Created by</caption>
            <summary>false</summary>
            <available>true</available>
            <expand>true</expand>
        </field>
        
        <field>
            <fieldname>INSTALLEDITEMTYPES.InstItemTypeCreatedDate</fieldname>
            <caption>Created on</caption>
            <fieldtype>date</fieldtype>
            <summary>false</summary>
            <expand>true</expand>
        </field>
        
        <field>
            <fieldname>UPDATEDBY.USERNAME</fieldname>
            <caption>Updated by</caption>
            <summary>false</summary>
            <available>true</available>
            <expand>true</expand>
        </field>
        <field>
            <fieldname>INSTALLEDITEMTYPES.InstItemTypeUpdatedDate</fieldname>
            <caption>Updated on</caption>
            <fieldtype>date</fieldtype>
            <summary>false</summary>
            <expand>true</expand>
        </field>
        
        <field>
               <fieldname>CREATEDBY.USERID</fieldname>
               <caption>Created By</caption>
            <filter>true</filter>
            <filteronexpand>true</filteronexpand>
            <filterlookupname>dataset;businessnetwork.searchusers;userid;userpersonname</filterlookupname>
            <summary>false</summary>
           </field>
           
           <field>
               <fieldname>UPDATEDBY.USERID</fieldname>
               <caption>Updated By</caption>
            <filteravailable>true</filteravailable>
            <filterlookupname>dataset;businessnetwork.searchusers;userid;userpersonname</filterlookupname>
            <summary>false</summary>
           </field>
    </fieldlist>
    
    <actions>
        <action>
            <caption>New</caption>
            <link>page.do?xml=inventory/installedItemTypeDetailBody&amp;act=new&amp;fc=createButton&amp;jndi=ejb/CRMUIInstalledItemType</link>
            <topmenu>true</topmenu>
        </action>
        <action>
            <caption>Set Default</caption>
            <link>javascript:displayModalCreate('inventory/setDefaultTypeDetailBody','ejb/CRMUIInstalledItemType','loadDefaultForm',null,'new',null,'','')</link>
        </action>
    </actions>
</summary>

As you can see, we defined all the fields and actions that we want our summary page to have. To access the summary page, we use the following URL:

Info
titleSummary page URL

http://localhost:9080/crm/page.do?act=summary&xml=inventory/installedItemTypeSummary The page generator renders HTML pages by generating static and dynamic pages using JSP elements and CRM.COM components. 

Child pages (Children Display)