USD contains panels on the left and right side, useful for lots of things including showing account overview information, maintaining random notes or as an area to hold the agent scripts.
I have found that it is sometimes helpful to be able to automatically expand or collapse these panels, when, for example, a session starts or a user closes a tab.
The steps involved are quite straight forward. The steps are;
- If not already available create uii action on “main” hosted control for SetVisualProperty.
- Create an action to expand (and close) the panel.
- Add the action call to appropriate positions.
Step One – Create uii action SetVisualProperty.
This may already exist but if not you’ll need to create!
Navigate to the hosted control used for the main layout in USD. In my example it is called “Main Layout”, check that there is a UII action called “SetVisualProperty”. If it doesn’t exist create one.
Step Two – Create an action to expand (and close) the panel.
Now you will need to create an action (or two). One to expand the panel and one to close it.
- Hosted Control = Main Layout
- Action = SetVisualProperty (As created above)
- Data = “elementname=RightPanelExpander, propertyname=IsExpanded, value=true”
In this example the elementname is “RightPanelExpander”, as it is the right panel I wish to expand.
To expand the left panel you’ll need to use “elementname=ExpanderSessionDetails“, not quite as obvious as RightPanelExpander!
The value setting of true will force a panel to expand, a value of false will collapse it.
Step Three – Add the action call to appropriate positions.
Finally you’ll need to add the action to a suitable event. In the example below the right panel close action has been added to the closing event of a hosted control. (In my example randomly called Fish!)
I’ve included this example as when trying to find an event to hand the close of the panel from the “Closing” event didn’t exist out of the box! Be aware of this, as you might need to create a suitable event. But generally speaking triggering the open of a panel from a session start or selection of a toolbar button should be quite straight forward.