cancel
Showing results for 
Search instead for 
Did you mean: 

Validate user input?

Former Member
0 Kudos

New to Java web dynpro. I have a web dynpro component which is embedded in portal. This component is a step of series of steps there. Now I want to validate a field of this component to see whether it is not empty or not. What do I have to do? There is no action in the view of the component controller like button clicked or something else similar. Any help appreciated. Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you are doing that in ESS webdynpro then you need to do that in OnFlush() function for validate in the component controller..

Otherwise let me know what validation you want.If it is input field then u can validate using onEnter property of input field.

Thanks

Kanai

Former Member
0 Kudos

Thanks! It is so strange when I right mouse click on the input element and choose properties, it doesn't show anything. I just want to make the SSN input field required.

Former Member
0 Kudos

Hi Kalai,

Yes I put the code into the flush function it seems to work. But how do I make it like standard message one like standard validation from SAP?

Thanks!

Answers (5)

Answers (5)

Former Member
0 Kudos

I got the answer, thanks!

Former Member
0 Kudos

Hi,

Assume you have node "A" which has attribute "name"

create a Simple type expand u r project-> Dictionories->data types-> Simple Type

and specify max and minimum length if you need to perform validation on length.

go to the properties of context attribute "name" and select type as simple type that you created.

Then perform null value validation in submit.

Object attributeValue = wdContext.nodeA().getCurrentElement().getAttributeValue("Name");

int length = (attributeValue == null) ? 0 : ((String)attributeValue).length();

if (length == 0) {

wdcompoentAPI.getmessagemanager.raiseException( "Name should not be blank",true);

}

Regards,

Sandeep Reddy.

former_member185086
Active Contributor
0 Kudos

Hi

Please refer this [thread| ;

Best Regards

Satish Kumar

Former Member
0 Kudos

What kind of validation you want to do?

Former Member
0 Kudos

Hi,

you have the onEnter property for the input filed right there u can write your validations.

and also your question is not clear, please make it clear,

Cheers,

Appu

Former Member
0 Kudos

Thanks! In normal Wed Dynpro component we have action when we click button or do whatever on the view then we can validate user input based on that action. Now it is special web dynpro component which is embedded in portal. We have no action to validate. I tried to figure it out to put validation code into post processing event. Is it the right place to put the code?

Former Member
0 Kudos

Hi,

Your Question is not clear..

What i understood is that u have an Input Field in your View and you need to wrie a validation for that..?

If that is the case, Go to the properties tab of the Input Field and there you can seee an OnEnter action.

Create a new action here and write your logic under this action

Jithin