Defining a properties view for a business object

A properties view shows all of the details for a business object. You can edit an existing object, or create a new instance of one (for example, a detailed view of all the criteria for a promotion) within a properties view.A properties view can contain multiple tabs, and within these tabs, there can be various user interface widgets, such as entry fields, check boxes, radio buttons, lists, tables, combination boxes. A properties view can also contain one or more property groups (wcfPropertyGroup) to help organize the details of the business object. To access a properties view, use the toolbar or menu to create a new object or navigate to an existing object and select the open action.

Before you begin

Before you define a properties view for a business object, ensure that you have defined the new object.

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > your_company_name > Management_Center_component > propertiesViews, where Management_Center_component is the name of your new custom tool.
    • Introduced in Feature Pack 2In the Enterprise Explorer view, expand LOBTools > WebContent > config > your_company_name > Management_Center_component > propertiesViews, where Management_Center_component is the name of your new custom tool.
  3. Create a properties view file:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1OpenLaszlo properties view library file WebSphere Commerce Version 7.0.0.0Feature Pack 1Use the following syntax to create this file: Business object name in camel casePropertiesView.lzx. For example, ProductPropertiesView.lzx.
    Introduced in Feature Pack 2Properties view definition file Introduced in Feature Pack 2Use the following syntax to create this file: Business object name in camel casePropertiesView.def. For example, ProductPropertiesView.def.
  4. Within this new properties view file:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1OpenLaszlo properties view library file WebSphere Commerce Version 7.0.0.0Feature Pack 1
    1. Define a class that extends wcfPropertyPane for each tab within the properties view. Name each class using a three-character Management Center component code (in lowercase), the business object name, and TabPaneContent. For example, if you are working with a product and this tab includes pricing information for the product, name the tab class catProductPriceTabPaneContent.
    2. Add property groups (wcfPropertyGroup) and user interface widgets (wcfPropertiesComponent) to the property pane class (wcfPropertyPane). For a list and details about the widgets that a properties view supports, refer to the OpenLaszlo API documentation for wcfPropertiesComponent and lzx/commerce/foundation/restricted/PropertiesComponent.lzx/wcfPropertyEditor
    3. Define a class that extends wcfObjectProperties. Name the class using a three-character Management Center component code (in lowercase), the business object name, and Properties. For example, catProductProperties. Add the tabs to the properties view class by declaring an instance of wcfPropertyTabs that includes instances of wcfPropertyTabPane. Instantiate the property pane classes that are defined in the previous steps as a child of the tab panes.
      The following example demonstrates the declaration of a properties view that has two tabs:
      <class extends="wcfObjectProperties" name="catProductProperties">
      
        <wcfPropertyTabs>
      
          <wcfPropertyTabPane text="${catalogResources.manageProductTab.string}">
            <catManageProduct/>
          </wcfPropertyTabPane>
      
          <wcfPropertyTabPane text="${catalogResources.descriptiveAttributesTab.string}">
            <catCatalogEntryDescriptiveAttributes/>
          </wcfPropertyTabPane>
      
        </wcfPropertyTabs>
      
      </class>	   
    4. Specify the name of the properties view class as the propertiesClass attribute of the object definition (wcfObjectDefinition) for which this properties view is being declared.
    Introduced in Feature Pack 2Properties view definition file Introduced in Feature Pack 2
    1. Create a definition that extends wcfPropertyPane for each tab within the properties view. Name each definition using a three-character Management Center component code (in lowercase), the business object name, and TabPaneContent. For example, if you are working with a product and this tab includes pricing information for the product, name the tab definition catProductPriceTabPaneContent.
    2. Add property groups (wcfPropertyGroup) and user interface widgets (wcfPropertiesComponent) to the property pane class (wcfPropertyPane). For a list and details about the widgets that a properties view supports, refer to the OpenLaszlo API documentation for wcfPropertiesComponent and wcfPropertyEditor.
    3. Create a definition that extends wcfObjectProperties. Name the definition using a three-character Management Center component code (in lowercase), the business object name, and Properties. For example, catProductProperties. Add the tabs to the properties view by adding a wcfPropertyTabs element that includes wcfPropertyTabPane elements. Add the property pane definitions that are defined in the previous steps as a child of the tab panes.
      The following example demonstrates the declaration of a properties view that has two tabs:
      <ObjectProperties definitionName="catProductProperties">
        <PropertyTabs>
          <PropertyTabPane text="${catalogResources.manageProductTab}">
            <PropertyTabPane baseDefinitionName="catManageProduct"/>
          </PropertyTabPane>
      
          <PropertyTabPane text="${catalogResources.descriptiveAttributesTab}">
            <PropertyPane baseDefinitionName="catCatalogEntryDescriptiveAttributes"/>
          </PropertyTabPane>
        </PropertyTabs>
      </ObjectProperties>
    4. Specify the name of the properties view definition as the propertiesDefinitionName attribute of the object definition (wcfObjectDefinition) for which this properties view is being declared.
  5. Optional: Use the wcfViewOption class to declare a view option that business users can use to toggle between different views within the properties view of an object. You can use enablement conditions that reference view options to control the visibility of property groups and property tab panes. You can declare more than one instance of wcfViewOption as a child of wcfPrimaryObjectDefinition. When the properties view of the primary object is visible, the view options are enabled in the View menu.

What to do next

After you complete your customization:
Version Steps
  1. Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the workspace_dir\LOBTools\WebContent directory. This setting is the default environment setting.
  2. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  3. Deploy your changes to your production environment.
Introduced in Feature Pack 2
  1. Test your changes by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
  2. Deploy your changes to your production environment.