Set focus on form field in WebUI

Problem: you want to have focus set to one of the fields of a form in the WebUI webpage.

Solution: what you want to do is to generate a GET_P_* method for the field you want to have focus set to. In the method you should change value for property called FOCUS.

METHOD get_p_some_field.
  CASE iv_property.
    WHEN if_bsp_wd_model_setter_getter=>fp_focus.
      rv_value = abap_true.
  ENDCASE.
ENDMETHOD.
METHOD get_p_some_field.
  CASE iv_property.
    WHEN if_bsp_wd_model_setter_getter=>fp_focus.
      rv_value = abap_true.
  ENDCASE.
ENDMETHOD.

Thanks to this, you are able to direct field’s focus based on ABAP conditions.

Komentowanie jest zakończone.