cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

140
Views
0
Helpful
2
Replies
Beginner

Macro for Group Button

Dear Colleagues,

I am going to write a simple macro for group button with no success. I guess the widgetID format does not fit, for example: group:call1 (widgetID: group, buttonID:call1)

 

Here you can see the current status:

 

const xapi = require('xapi');


function guiEvent(event) {
if (event.Type === 'pressed' && event.WidgetId === 'group:call1'){
xapi.command('Dial', { Number: 'call1@domain.com' });
}
if (event.Type === 'pressed' && event.WidgetId === 'group:call2'){
xapi.command('Dial', { Number: 'call2@domain.com' });
}
if (event.Type === 'pressed' && event.WidgetId === 'group:call3'){
xapi.command('Dial', { Number: 'call3@domain.com' });
}
}
xapi.event.on('UserInterface Extensions Widget Action', guiEvent);

 

 

----------------------------

 

<Extensions>
<Version>1.5</Version>
<Panel>
<PanelId>Quick_dial</PanelId>
<Type>Statusbar</Type>
<Icon>Handset</Icon>
<Order>2</Order>
<Name>Quick Dial</Name>
<Page>
<Name>Quick Dial</Name>
<Row>
<Name>Call</Name>
<Widget>
<WidgetId>group</WidgetId>
<Type>GroupButton</Type>
<Options>size=4</Options>
<ValueSpace>
<Value>
<Key>call1</Key>
<Name>One</Name>
</Value>
<Value>
<Key>call2</Key>
<Name>Two</Name>
</Value>
<Value>
<Key>call3</Key>
<Name>Three</Name>
</Value>
</ValueSpace>
</Widget>
</Row>
<PageId>Quick_dial</PageId>
<Options/>
</Page>
</Panel>
</Extensions>

 

Would you be so kind to help me out?

 

Thanks,

Laszlo

2 REPLIES 2
VIP Advisor

Re: Macro for Group Button

I'm not sure why you would want to do this with a group button which would normally be a switch between different functions.  

You would be better off using normal buttons - there is an example of creating these types of Speed Dial buttons on github: https://github.com/CiscoDevNet/roomdevices-macros-samples/tree/master/Speed%20Dials

Wayne
--
Please remember to rate responses and to mark your question as answered if appropriate.
Beginner

Re: Macro for Group Button

Hi,

Thank you for your reply.

 

In the meantime I found the solution:

if (event.Type == 'released' && event.WidgetId == 'group' && event.Value == 'call1')

instead of

if (event.Type == 'released' && event.WidgetId == 'group:call1')

 

Kind regards,

Laszlo

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards