cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

read input field

Former Member
0 Likes
392

Hi..

I nead to read a htmlb input field from the application class.

i aam using the below code in oninput processing.

w_sc ?= cl_htmlb_manager=>get_data( request = runtime->server->request

name = 'inputField' id = 'PC_IN7' ).

application->vPC_IN7 = w_sc->value.

but i need to do the same thing in the application class method and not in oninput processing.

can this be done..

Thanks

Dinesh

View Entire Topic
Former Member
0 Likes

Hi Dinesh,

In an application class method you can't do this, because we dont have access to runtime/request object in the application class method..

What we can do is using

request->get_form_field( '<id>' )

in onInputProcessing we can take the value of the attribute and pass it on to a method of application class as parameter.

Hope this helps..

Regards,

Ravikiran.

eddy_declercq
Active Contributor
0 Likes

Hi,

Another possibility is that you define PC_IN7 as a page attribute with AUTO property set to on.

Then you can do

application->PC_IN7 = PC_IN7.

Eddy

Former Member
0 Likes

Hi Ravi.. can u elobrate more.. what do i need to specify in id

Thanks.

Former Member
0 Likes

Say you have a input field in your layout as:

<htmlb:inputField id      = "mat_num"
                          type    = "STRING"
                          tooltip = "Enter Material Number"
                          value   = "<%= matnr %>" />

Now in your onInput processing you can get the value entered in the input field as:

matnr = request->get_form_field( 'mat_num' ).

Now, say if you have a method in your application class, which accepts this material number as importing parameter then you can pass it as:

application->ITEM_CREATE( MATERIAL = matnr ).

Hope this would help you,

Regards,

Ravikiran.