04-17-2018 12:55 PM - edited 03-18-2019 02:02 PM
I am trying to push a multiline command through macros in order to update the UI with the press of a button. The command I am attempting to send is (I have significantly shortened the xml in my debugging):
xapi.command('UserInterface Extensions Set', { ConfigId: 'AdvancedSettings', 'body': '<Extensions><Version>1.5</Version><Panel><PanelId>AdvancedSettings</PanelId><Type>Statusbar</Type><Icon>Sliders</Icon><Order>1</Order><Color>#A866FF</Color><Name>Advanced</Name></Panel></Extensions>' });
Every time I push this in 9.3, I receive an error in the console:
'Unhandled promise rejection' { code: 0, message: 'Failed to parse xml', data: { status: 'Error', Reason: 'Failed to parse xml' } }
When I tested this with CE9.2.3, the UI will partially update, but not consistently.
Is there some trick to sending xml/multiline commands using macros?
Solved! Go to Solution.
04-20-2018 01:27 AM
I copied your code example into my macro editor on a SX80 running CE9.3 release software. I ran the code and a button was created with the color. I can also change the color (by modifying the color code and re-run the code). Not sure why you are seeing this.
Do you have any more details?
/Magnus
04-17-2018 02:01 PM
04-20-2018 01:27 AM
I copied your code example into my macro editor on a SX80 running CE9.3 release software. I ran the code and a button was created with the color. I can also change the color (by modifying the color code and re-run the code). Not sure why you are seeing this.
Do you have any more details?
/Magnus
04-20-2018 04:18 PM
Ok it just worked for me. It turns out the issue had to do with creating the page then setting the button values immediately was causing the issues. I added a setTimeout to pause it, and it was enough to make the error go away.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide