sapdev logo background
sapdev logo sapdev logo
Comments

MVC BSP HTMLB input field - Demonstrate how to retrieve a value entered into text input field




Below is the basic code for allowing users to input text onto a html page and retrieve what they have entered using HTMLB and MVC techniques.

Display input field and retrieve value entered using the MVC technique

Layout
------
The code below is HTMLB.
            <htmlb:inputField id            = "fieldId"
                        invalid        = "true"
                        value          = "<%=stuid%>"
                        required       = "true"/>



DO_REQUEST method (within BSP MVC controller class)
-----------------
  DATA: data_input TYPE REF TO cl_htmlb_inputfield,
        ld_fieldid  TYPE zstudtls-stuid.

  data_input ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                      name    = 'inputfield'
                                      id      = 'fieldId' ).
  IF data_input IS NOT INITIAL.
    ld_fieldid = data_input->value.
  ENDIF.



See example BSP using HTML to get user input




comments powered by Disqus