cancel
Showing results for 
Search instead for 
Did you mean: 

read input field

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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 Kudos

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 Kudos

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

Thanks.

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

sreemsft
Contributor
0 Kudos

Hi Dinesh,

You cannot capture the value of input field in the application class. But you can store the value of input field in Application Class.

You can keep the code in the OnInputProcessing, and store the value of it in the Application Class.

Please do not forget to give points for the helpful answers

Thanks,

<b>Sreekanth</b>