Example of the DimCombo Component Layout

Before executing the example see recommendations for code writing. Make sure that the repository contains a dictionary with the 102770 key.

To create the DimCombo component, use the HTML code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>DimCombo</title>
    <script type="text/javascript" src="../build/PP.js"></script>
    <script type="text/javascript" src="../build/PP.Metabase.js"></script>
    <script type="text/javascript" src="../build/PP.App.js"></script>
    <link href="../build/PP.css" rel="stylesheet" type="text/css" />
    <link href="../build/PP.Metabase.css" rel="stylesheet" type="text/css" />
    <link href="../build/PP.App.css" rel="stylesheet" type="text/css" />    
</head>
<body>
    <div id="simpl"></div>
    <div id="button"></div>    
    <script type="text/javascript">
        PP.resourceManager.setRootResourcesFolder("../Resources/");
        PP.setCurrentCulture(PP.Cultures.ru);
        // Create progress bar
        var waiter = new PP.Ui.Waiter();
        // Set up repository connection
        var mb = new PP.Mb.Metabase({
            // Set URL of PP.SOM web service in the format:
            // <http://<ServerName | IP-address>[:<Port>][/<VirtualCatalog>]/axis2/services/PP.SOM.Som>
            PPServiceUrl: "http://localhost/fpBI_App_v10.x/axis2/services/PP.SOM.Som",
            // Specify repository identifier and credentials
            Id: "Repository",
            UserCreds: {
                UserName: "user",
                Password: "password"
            },
            StartRequest: function () {
                // Display component of the PP.Ui.Waiter type on metadata request
                waiter.show();
            },
            EndRequest: function (sender, args) {
                // Hide component of the PP.Ui.Waiter type
                waiter.hide();
            },
            Error: function (sender, args) {
                // Display error description if it occurs
                console.log(args.ResponseText);
            }
        });
        // Open repository connection
        mb.open();
  
        // Create a service fort working with dimensions
        var dimSrv = new PP.Mb.DimSrv({ Metabase: mb});
        // Open dictionary with the 102770 key
        var dim = dimSrv.open(102770, false, true);
 
        // Create the DimCombo component
        dimCombo = new PP.Mb.Ui.DimCombo({
            TreeView: { Source: dim, Service: dimSrv },
            ParentNode: document.getElementById("example"),
            Width: 400
        });
    </script>
</body>
</html>

After executing the example the HTML page contains the DimCombo component that displays the drop-down list with dictionary elements with the 102770 key:

See also:

Classes Used to Work with a Dimension