Share via


Creating a Simple List

There are two ways to create a Simple List. You can create a Simple List by dragging the Simple List result viewer (located in the Business Portal web part gallery) onto your page and configuring it.

You can also create a Simple List as an ASP, ASPX, or HTML file. To display this file in Business Portal, you must drag the Page Viewer web part (located in the Business Portal web part gallery) onto your page and configure it to point to your ASP, ASPX, or HTML file. The following example shows the HTML code used to create a Simple List.

<html XMLNS:SL>
    <head>
        <?IMPORT namespace="SL" implementation="/BusinessPortal/UI/
            ResultViewer/Scripts/Simple.htc"/>
        <title>Simple List</title>
        <script>
            function OnSimpleList1Ready()
            {
                //Add a stylesheet.
                SimpleList1.AddStyleSheet("/BusinessPortal/UI/
                    ResultViewer/Stylesheets/SimpleList.css");
            }
        </script>
    </head>
    <body style="margin:0">
        <SL:Simple
         ID="SimpleList1"
         HasAutoRefresh="true"
         AutoRefresh="10"
         OnReady="OnSimpleList1Ready()"
         QueryServiceURL="/BusinessPortal/QueryWebService.asmx?WSDL"
         QueryPath="/Inventory/Items/Items In Stock"
        />
    </body>
</html>

The ?IMPORT element has a namespace attribute and an implementation __ attribute. The namespace attribute specifies the namespace of the Simple List. The implementation attribute specifies the path to the HTC component implementing the Simple List.

<?IMPORT namespace="SL" implementation="/BusinessPortal/UI/
    ResultViewer/Scripts/Simple.htc"/>

The AddStyleSheet() method is called to apply the Simple List stylesheet settings to the result viewer. This method takes the URL location of the stylesheet as a parameter.

function OnSimpleList1Ready()
{
    //Add a stylesheet.
    SimpleList1.AddStyleSheet("/BusinessPortal/UI/
        ResultViewer/Stylesheets/SimpleList.css");
}

The location of the Query Web Service is specified by assigning the location to the QueryServiceURL property.

QueryServiceURL="/BusinessPortal/QueryWebService.asmx?WSDL"

The QueryPath property specifies the query that will be displayed when the Simple List is initialized. You must supply a path to an existing query.

QueryPath="/DataViewer/Inventory/Items/Items In Stock"