cancel
Showing results for 
Search instead for 
Did you mean: 

Validating User input

Former Member
0 Kudos

Hi folks,

I had a scenario, where I need to validate the User Input.

As of now, I am doing the validation in seperate method which triggers when the user clicks enter button. i.e, the method is linked to the button.

If the validation passes, it will triggers another method, Otherwise it will thows an error message and returns.

Which will cause a round trip i.e., entire phase model will happens.

My question is " Instead of writing validations in a seperate method, May I write the validation check in WDDOBEFOREACTION Method.?"

Is it improves the performance? Is this the best practice?

Thanks in Advance,

Bull Eye

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Depending upon the flow you want to achieve it can certainly be better to trigger your validation method from WDDOBEFOREACTION. From the online help:

+If this type of error message is generated before an action handler is called (for example, in WDDOBEFOREACTION methods), actions of the type standard are no longer executed. Subsequent navigation and WDDOMODIFYVIEW methods are also not executed. However, validation-independent actions are executed even if error messages exist. +

Former Member
0 Kudos

WDDOBEFOREACTION will call before on every action (i.e F4, enter or other actions). So the code for validation would triggered on every user action.

As per my view, the best practice is to write the code in the respective event handler of the UI elements. In ur condition you still have your code in Button's event handler.

There is nothing related with performance.

Hope it helps.