In this lesson, you create the properties view definition
for your custom widget. The definition file specifies how to render
the Management Center properties view for your widget. The properties
view for your widget contains the configurable properties that business
users can set when the widget is included in a page layout. The configurable
properties are used to set the information that determines the rendering
of the widget and the rendering of the data within the widget on a
store page.
Procedure
- In the Enterprise Explorer view, go
to the LOBTools\WebContent\config\mycompany\pagelayout\widgetDefinitions\ShoppingCartDetailPageWidget directory
within your default workspace directory structure.
- Open the WidgetPropertiesView.def file
for editing.
By default the generated code for your widget
object definition can resemble the following code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- The following code is created as example. Modify the generated code and add any additional required code. -->
<Definitions>
<GridObjectProperties definitionName="plmWidgetProperties_ShoppingCartDetailPageWidget">
<PropertyPane>
<PropertyGroup name="widgetProperties" collapsable="false" groupTitle="${plmPageLayoutResources.widgetPropertiesPrompt}">
<PropertyInputText name="${plmPageLayoutResources.widgetNamePrompt}" propertyName="widgetName"
promptText="${plmPageLayoutResources.widgetNamePrompt}" />
</PropertyGroup>
<PropertyGroup name="contentProperties" collapsable="false" groupTitle="${plmPageLayoutResources.widgetContentPrompt}">
<PropertyStaticText text="${mycompanyPageLayoutResources.ShoppingCartDetailPageWidgetContent}" />
</PropertyGroup>
</PropertyPane>
</GridObjectProperties>
</Definitions>
The preceding code sample defines a properties
view for the new widget, which consists of only the widget name and
the content description.
- Update the properties view definition file to change any
of the default generated configurable properties, or add more configurable
properties for your widget.
- Save and close the file.
- Start or restart the WebSphere Commerce
Test Server.
- Right-click the LOBTools project.
Click Build OpenLaszlo Project.