cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use user defined error messages in Value Help?

Former Member
0 Kudos

Hi,

I'm currently working on a Modifiable Value Help Selector in Web Dynpro Java, and I want to use a user defined error message when I validate the values entered by a user. Currently, it's returning its default error message ("Character <string> does not match...").

Since the project requires a different error message, is there a way to override the default error message and use my defined error message instead?

Thanks!

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Angelo.

Try create new calculated attribute and bind your value selector to it. Write your validation / exception handling and messaging code in the set-method of the calculated attribute.

siddharth_jain
Active Contributor
0 Kudos

Hi Angelo,

I am not sure why message area is showing both Custom and inbuilt messages but you can try the following:

i guess you must be using reportContextAttribute exception for showing Error messages on the input fields as well.in that case you can disable the message area so messages will appear only on the Context level ie; on input fields.

For other messages apart from validation messages you can enable the message area before reporting the exception.

make sure the boolean context variable which will be used for enabling and disabling the message area should have Readonly property set as true.

I am not sure whether this is the only solution for this but you can try and see if it works.

Siddharth

siddharth_jain
Active Contributor
0 Kudos

Hi,

try the following

Go to the action tab of view and edit the action associated with button.

check the without validation check box. deploy the new archive and run.

Siddharth

Former Member
0 Kudos

Hi Siddharth!

Thanks for replying again on my thread! Your idea worked, which means I am now able to see the custom error message, but it now shows both error messages on the UI Message Area (the default and custom one).

Would you know if there is a way to remove the default error message, and just show the custom message?

Thanks once again!

Former Member
0 Kudos

Hi,

Catch the default exception and display your own message. This way you should see the user defined message instead of the default error message.

Regards,

Anagha

Former Member
0 Kudos

Would you know what exception that is throwing?

Former Member
0 Kudos

When the user enters a value, get an OnAction...() method triggered. In that method, handle your input validation.

Former Member
0 Kudos

How about if I want to validate it when the user presses a button? I coded the user defined error messages, but it keeps on overriding those error messages with the default one.

Former Member
0 Kudos

Hi,

onAction() property of the input field you can use for the custom error message.

override the default error message, i have no idea!

Regards,

ramesh