Change parameter in OneClick customization from Unicode to Hexadecimal

Document ID : KB000048951
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

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>

Solution:

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>