cancel
Showing results for 
Search instead for 
Did you mean: 

form Input

Former Member
0 Kudos

I am checking for some required fields on the form. The issue here is that suppose something like first Name is coming in with a value from a RFC and then the user deletes it on the input field in the dynpro.

Now if I do a check on this field it is not giving an error inspite of there being no text in the input field.

However if the user changes the text the modified text is going to the DB but mandatory check is not picking up that the input field has no text if the original text has been deleted. Do we need an on enter event in a form to check this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Deepak,

"<i>Now if I do a check on this field it is not giving an error inspite of there being no text in the input field</i>"

How do you check for the text & where do you call this check? If you set the 'state' of the inputfield to 'required', it will just display an asterik mark next to the field, but no validation is done. So in the required action handler (for eg: the action handler for calling the RFC for write operation), do a simple validation like:

if((null==wdContext.current<node_name>Element.get<attr>())||("".equals(wdContext.current<node name>Element.get<attr>().trim()))

wdComponentAPI.getMessageManager.reportSuccess("Input blank");

where 'attr' is the name of the attribute to which the 'value' property of the input field is bound and 'node_name' is the name of the node having this attribute. If the attribute is a context attribute, node_name would be 'Context'.

Hope this helps,

Best Regards,

Nibu.

Answers (0)