cancel
Showing results for 
Search instead for 
Did you mean: 

Validation in component controller

Former Member
0 Kudos

Hi,

I have a dropdown in my view .Now i have to validate that user must select a value from it. I am not able to high light it in red, One thing I have to write my method IN COMPONENT CONTROLLER only.

My previous post i got no answer.

Any one please help me, its urgent.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

In the property "input type" of the drop down, you can make it "required". This will show a red sign next to the field. If you want the validation in the comp controller, your context node should be in the comp controller and mapped in your view. In your view, on a button event handler maybe, do a get_attribute of the drop down attribute. If it is initial, throw an exception message.

Regards

Nithya

Former Member
0 Kudos

I am using this code. But it is not highlighting the attribute,i am decleared the state as required, can u suggest whats wrong?

*VAlidate exit type

IF item_exit_type IS INITIAL.

lv_text = wd_assist->if_wd_component_assistance~get_text( key = c_error_key_1 ) .

  • report message

CALL METHOD l_message_manager->report_attribute_error_message

EXPORTING

message_text = lv_text

element = elem_exit_type

attribute_name = 'EXIT_TYPE'.

ls_param-name = '1'.

ls_param-value = stru_exit_type-exit_typE.

APPEND ls_param TO lt_params.

iserror = iserror + 1 .

ENDIF.

Message was edited by:

Prosun Bondopadhyay