Skip Navigation
Expand
ORACLE_SERVICE_CLOUD.extensionResizeHandler.resize not resizing
Answer ID 10274   |   Last Review Date 07/24/2019

Why does my BUI extension remains the size as it would be without using ORACLE_SERVICE_CLOUD.extensionResizeHandler.resize?

Environment:

Agent Browser UI (BUI) Extensibility Framework

Issue:

I am developing a BUI extension and am trying to limit the width of the extension so it takes up less space. For this I am using the ORACLE_SERVICE_CLOUD.extensionResizeHandler.resize function documented here.

The extension uses the following two files:

init.html
toolbar/toolbar.html

The extension will show up if installed to an 18A site and access is enabled per-profile. The init.html file contains this (function in bold):

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="https://brokensites-cust-1.custhelp.com/AgentWeb/module/extensibility/js/client/core/extension_loader.js"></script>

<script>
    ORACLE_SERVICE_CLOUD.extension_loader.load("BrokensitesCustExtensionsToolbar" , "1")
    .then(function(extensionProvider)
        {
            extensionProvider.registerUserInterfaceExtension(function(IUserInterfaceContext)
            {
                IUserInterfaceContext.getExtensionBarContext().then(function(IExtensionBarContext)
                {
                    IExtensionBarContext.setDockable(true);
                    IExtensionBarContext.getExtensionBarItem('id').then(function(IExtensionBarItem)
                    {
                        console.log("Hello World from Toolbar!");             
                       
                        IExtensionBarItem.setContentUrl('/toolbar/toolbar.html');
                        ORACLE_SERVICE_CLOUD.extensionResizeHandler.resize(220, null);
                        IExtensionBarItem.render();
                    });
                });
            });
        });
</script>
</head>
<body>
</body>
</html>


The product documentation indicates this as an appropriate use of the function as far as I can tell:

"The ExtensionResizeHandler object controls the size of a workspace extension or extension bar item. Call it within the extension that you want to resize."

also

"The following code is an example of using the resize function:

ORACLE_SERVICE_CLOUD.extensionResizeHandler.resize(60,80);
"
Yet the extension remains the size as it would be without using the function. Why is this?


Resolution:

The issue with the code written is that the code should be called from within toolbar.html rather than init.html.