IBM Support

Customization to avoid the comma/dot separator in the integer value format on Start Center Result Sets

Technical Blog Post


Abstract

Customization to avoid the comma/dot separator in the integer value format on Start Center Result Sets

Body

There is a technote on this issue which can be seen through this link.

Let me quote the question from the technote:

- When an attribute is defined as either smallint or Integer data type and shown in the screen, the value entered in the field shows like "1,300"

Technote suggests to change user’s locale from system regional and language options. This is not a practical solution considering customer reality. A tiny customization can be an alternative solution.

 

Resolution:

The display is configured in the following jsp: maximo.ear/maximouiweb.war/webclient/components/resultsetportlet.jsp.

Take a backup copy of the original jsp file. Next, find the code piece below:

if(displayData!=null)
{
    String finalData = !(isBidiEnabled && rInfo != null)? displayData.getData() :
    BidiUtils.applyBidiAttributes(rInfo,arrColumn[0],displayData.getData(),langcode);
    %><%=WebClientRuntime.makesafevalue(finalData)%><%
}

Then modify the code piece with the following part, where the customization is emphasized in bold font. It just checks if the field is of data type integer (6), smallint (7) or bigint (19) and then replaces commas and dots with empty string.

if(displayData!=null)
{
    int dataType = displayData.getTypeAsInt();
    boolean isInteger = dataType == 6 || dataType == 7 || dataType == 19;

    String finalData = !(isBidiEnabled && rInfo != null)? displayData.getData() :
    BidiUtils.applyBidiAttributes(rInfo,arrColumn[0],displayData.getData(),langcode);
    if(isInteger){
        finalData = !(isBidiEnabled && rInfo != null)? displayData.getData().replace(".","").replace(",","") :
        BidiUtils.applyBidiAttributes(rInfo,arrColumn[0],displayData.getData(),langcode);
    }
    %><%=WebClientRuntime.makesafevalue(finalData)%><%
}

Editing the jsp file takes effect instantly, it does not require system restart and that's it.

[{"Business Unit":{"code":"BU005","label":"IoT"}, "Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm11130463