cancel
Showing results for 
Search instead for 
Did you mean: 

Field validation with popup message

Former Member
0 Kudos

Hello,

I have a form for saving email addresses. In this form you have to type your email in a input-field an then you must retype it in another input-field. After clicking a button the email address is stored ....

How can i display a PopUp (or something like that) when the two addresses are different? Further the navigation to the next view, where I store the address should stopped and the user have to check his data.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member215843
Active Participant
0 Kudos

Hi Chris,

The standard method is to display a message in the message area.

You can do this in WDDOBEFOREACTION:

  data lo_api_controller type ref to if_wd_view_controller.
  data lo_action         type ref to if_wd_action.

  lo_api_controller = wd_this->wd_get_api( ).
  lo_action = lo_api_controller->get_current_action( ).

  if lo_action is bound.
    case lo_action->name.
      when '...'.
*    TODO: check whether both attributes are identical.
*    if not, use the code wizard to report an error message 
*    REPORT_ATTRIBUTE_ERROR_MESSAGE and
*    enter the element reference and the attribute name of the second field.
    endcase.
  endif.

Then the action handler will not be called in case of an error.

Ciao, Regina

Former Member
0 Kudos

Hi Regina,

thanks for your help - it works !!!

...but is it possible to display the error message in PopUp ? That would be pretty nice

greetz

Chris