Change parameter in OneClick customization from Unicode to Hexadecimal
search cancel

Change parameter in OneClick customization from Unicode to Hexadecimal

book

Article ID: 48951

calendar_today

Updated On:

Products

Spectrum

Issue/Introduction

When customizing the custom-menu-config.xml to launch a browser, the parameter may be displayed in Unicode but you might require hexadecimal.

It will need to be converted to hexadecimal using the Long.toHexString java method.

In the example below the cause code attribute is needed in hexadecimal but displays in the URL as Unicode. This would lead to a 404 webpage not found error.

        <launch-browser>
  <url>http://www.x.com{0}</url>
  <param>
        <attribute>AlarmAttrID.CAUSE_CODE</attribute>
   </param>
        </launch-browser>
 

Environment

Release: Any
Component:

Resolution

Edit the code to use the Long.toHexString method to return the hexadecimal equivalent of the long value.

  <launch-browser>
            <url>http://www.x.com{0}</url>
            <param>
                 <expression>"0x" + Long.toHexString( attrLong(AlarmAttrID.CAUSE_CODE) )</expression>
            </param>
  </launch-browser>