Hello,
I'm currently developing a macro for a Cisco DX80 device. In that macro, I have these Javascript methods that I use to create a panel which contains a button and a few toggle buttons:
async function uiAddPanel(panelName, participantsRows = []) {
const panelId = `${panelPrefix}${panelName}`;
const xml = `<Extensions>
<Version>1.7</Version>
<Panel>
<Order>1</Order>
<PanelId>examplePanel</PanelId>
<Origin>local</Origin>
<Type>InCall</Type>
<Icon>Lightbulb</Icon>
<Name>Example Panel</Name>
<ActivityType>Custom</ActivityType>
<Page>
<Name>List</Name>
${participantsRows.join("")}}
<Row>
<Name>Option 1</Name>
<Widget>
<WidgetId>optionOneWidget</WidgetId>
<Name/>
<Type>Button</Type>
<Options>size=2</Options>
</Widget>
</Row>
<Options/>
</Page>
</Panel>
</Extensions>`
console.info(`Adding panel ${panelId}`);
await xapi.Command.UserInterface.Extensions.Panel.Save({
PanelId: panelId,
}, xml);
}
function uiRow(participantName, widgetId) {
return `<Row>
<Name>${participantName}</Name>
<Widget>
<WidgetId>${widgetId}</WidgetId>
<Type>ToggleButton</Type>
<Options>size=1</Options>
<Value>
<Key>0</Key>
<Name>on</Name>
</Value>
</Widget>
</Row>`;
}
In the uiRow method, I'm trying to hardcode values to test if I can instantiate a toggle button in the "ON" position but I can't figure out how to do it.
Does Cisco have some documentation where it describes how to build a UI using XML? I've searched everywhere but the only things I've found were examples where the toggle button is instantiated in the "OFF" position.
Kind regards,
Simon