using @baseclass errors section to display error message but extra space observed in msg

Hi all,

for error msg extra space is displayed in between “:” and “Please”.

How to remove additional space?

Look for field value with mentioned text, the message is often fetched by getlocalizedlabel function.

To help you we need exact rule name (if it is out of the box one).

Hi Ivang,

ErrorList is section we are calling to display error messages.

@pxAddMessageToPage(@getLocalizedText(“UpdateAtLeastOneField”,“pyMessageLabel”,tools)) we are calling it this way .

UpdateAtLeastOneField is the messgae rule of category error

but for other messages also we are getting the same issue.

Is there any way to fix it for all error messages.

in 8.1.5 version we are not getting space.

space issue.PNG

UpdateAtLeastOneField seems to be the Message rule created by your team and not out-of-the-box Pega rule. Can you share the screenshot of that rule? It looks like between the static text of the message which ends with “:” and the parameter in curly brackets {} there might be a space which can be removed.

A possible (non-elegant) solution to address this might be to apply a @replaceAll(local.YourString,“: “, “:”) function before calling pxAddMessageToPage. This is, however, a bit dangerous - you might have a place where you need extra space after colon (”:”) but it would be gone too.

P.S.

Out of curiosity - why do you need to remove spaces after colon? According to many sources it is grammatically right to have space after colon:

As I can see in the ErrorList section contains the ": " in the html, as the section is final there is no way to change it. I think if you really need to remove it consider creating new section to handle errors and refer the same in your perform harness.

Section: ErrorList in @baseclass.

tools.appendString(strPropertyLabel+ ": ");

-Saikat