다음을 통해 공유


Simple Property List Web Part

The Simple Property List Web Part displays a product's details by using cascading style sheet formatting. This Web Part lets you format Commerce Server 2009-based product property details. The Simple Property List Web Part lets you choose a list of properties to display on a product page. Properties display in a simple vertical list. Commerce Server 2009 retrieves display properties from the Product Provider Web Part through a Web Part connection at page-render time. You can use a pop-up picker from the Web Part property pane that supports:

  • The selection of properties to display. This is a closed-vocabulary list retrieved from Commerce Server 2009, with the option to add additional properties to the list maintained by the Product Provider Web Part.

  • A CSS tag to wrap the output property in a <div> with the specified tag

In addition to the ability to pick the properties to display, the Simple Property List Web Part lets you choose the order in which to display the properties.

The Property Style Editor is accessed by clicking the button in the Property Styles area of the custom Editor Part. You are presented with an editable grid view that contains all the properties previously selected. You can then edit formatting attributes of the display based on two types of input:

  • Input of a valid class name available to the Web Part through CSS inclusions on the page or site

  • Input of valid inline CSS formatting

You can also apply a valid class name to the table in which the properties display. The class name must be available to the Web Part through the master page. You only need to input a valid class name in the text box in the Table Styles area on the custom Editor Part.

The Simple Property List Web Part does not pass the product ID to the Product Provider Web Part. The Product Provider Web Part consumes the product ID from the URL query string, retrieves the product from Commerce Server 2009, and passes the product to the Simple Property List Web Part.

Architecture

The Simple Property List Web Part contains these components:

  • IProductConsumer: allows consumption of the Product Provider Web Part connection

  • PropertyPicker.aspx: use to select properties to query

  • BaseWebPart: base class for all Web Parts

  • SimpleStylePicker.aspx: allows the property styles to be set

Customization

You can customize the Simple Property List Web Part by modifying the .aspx file.

Error Handling

The Simple Property List Web Part requires that a product ID be supplied in the query string. When a product ID is not found, the shopper is prompted with a message onscreen in the place of the product properties display.

The Simple Property List Web Part requires a connection to the Product Provider Web Part in order to retrieve the product. An error message displays if no connection exists.

The Simple Property List Web Part is a consumer of supplied data. The Simple Property List Web Part tests its connection within a try-catch block and tests for data returned. It makes no attempt to modify this data.

The Simple Property List Web Part returns friendly messages when an error is encountered. Such errors include failing to supply a product ID or a catalog name. If the Simple Property List Web Part fails to receive data, the properties are styled and displayed with no data in the cells where the values are to appear.

This Web Part does not retrieve data from Commerce Server 2009; rather, it is dependent on its connection to the Product Query Web Part to retrieve this data. As such, you must have Commerce Server 2009 installed and available to the Product Query Web Part. As a consumer of the Product Query Web Part, the Simple Property List Web Part must implement the [IProductConsumer] interface

See Also

Other Resources

Developing with SharePoint Commerce Services

Catalog System Web Parts

Working With the Simple Property List Web Part