SourceForge.net Logo

Defining a Grid

The following few lines of the UI config file define a Grid Tab:

Example 4-11. Grid Tab Definition

.
<!--Grid Tab Definition-->
<org.openmdx.ui1.ElementDefinition name="org:opencrx:kernel:segmentName:ClassName:referenceName">
  <_object>
    <active>true</active>
    <toolTip>
      <_item>ToolTip for TabA</_item>
    </toolTip>
    <label>
      <_item>TabA</_item>
    </label>
    <order>
      <_item>0</_item>
      <_item>0</_item>
      <_item>10</_item>
    </order>
  </_object>
  <_content/>
</org.openmdx.ui1.ElementDefinition>
.

The above code defines the following Grid Tab properties (and Figure 4-1 shows what the customized Grid looks like):

  • the order (0,0,10) is assigned to the Tab (the first of the three numbers is the pane number; for each unique pane number a complete grid is created and panes are displayed in increasing order - this feature allows you to display multiple grid tabs on the same page at the same time, i.e. without server roundtrips; multiple Tabs in the same pane are ordered by ascending order of the second and third number)

  • the Tab is active, i.e. visible

  • the toolTip of the Tab

  • and the label (i.e. name) of the Tab

Figure 4-5. Multiple Grid Panes

Without additional customization the Grid usually displays the first few attributes of an object, whereas the attributes are ordered by ascending order numbers (tab, fieldgroup, pos). If there is need to change that ordering for the purpose of changing the order in the Grid you can change the element definition of the relevant attributes. The following example shows, how one would move Attribute3 to the first position in the Grid by replacing the tag <order> with the tags <orderFieldGroup> and <orderObjectContainer>:

Example 4-12. Field Ordering in the Grid

.
<org.openmdx.ui1.ElementDefinition name="org:opencrx:kernel:segmentName:ClassName:Attribute3">
  <_object>
    <active>true</active>
    <toolTip>
      <_item>ToolTip for Attribute0</_item>
    </toolTip>
    <label>
      <_item>Label0</_item>
    </label>
    <orderFieldGroup>
      <_item>0</_item>  <!-- tab   -->
      <_item>0</_item>  <!-- group -->
      <_item>10</_item> <!-- pos   -->
    </orderFieldGroup>
    <orderObjectContainer>
      <_item>0</_item> <!- pane                    -->
      <_item>0</_item> <!- gridOrderNumber1 -->
      <_item>1</_item> <!- gridOrderNumber2 -->
    </orderObjectContainer>
  </_object>
  <_content/>
</org.openmdx.ui1.ElementDefinition>
.

The Tabs in the Grid have a slightly different meaning than the Tabs in the Inspector, as each Tab in the Grid represents a reference defined in the UML model (remember that Tabs in the Inspector are defined by the customizer and mainly serve the purpose of structuring the attributes of an object). That is why you cannot "create" new Grid Tabs as a customizer. You can, however, change the order of these Tabs, you can (re)name them, or you can hide them.

You can easily control the #attributes visible in the Grid and the #attributes available in the search menu by setting maxMember and showMaxMember to the desired values (see Figure 4-6 for details).

Figure 4-6. Grid Customizing with maxMember and showMaxMember

The following few lines of the UI config file account.xml define a Grid Tab Accounts as shown in the figure above:

Example 4-13. Grid Tab Definition with maxMember/showMaxMember

.
<!--Grid Tab Definition with maxMember/showMaxMember -->
<org.openmdx.ui1.ElementDefinition name="org:opencrx:kernel:account1:Segment:account">
  <_object>
    <active>true</active>
    <toolTip>
      <_item>all Accounts</_item>
    </toolTip>
    <label>
      <_item>Accounts</_item>
    </label>
    <order>
      <_item>0</_item>
      <_item>0</_item>
      <_item>10</_item>
    </order>
    <maxMember>20</maxMember>  
    <showMaxMember>8</showMaxMember>  
  </_object>
  <_content/>
</org.openmdx.ui1.ElementDefinition>
.

At the time of writing this guide the default value of maxMember is equal to 6 and the default value of showMaxMember is equal to the value of maxMember; furthermore, the upper limit for maxMember is set to 20.

http://www.crixp.com/ http://www.openmdx.org/