on 10-14-2008 11:58 AM
Hello friends,
In a BSP, i have added a dropdown in one of the htm pages, but I can't seem to get the selected value in the OnInputProcessing.
In the layout i've added this code:
<hcmlso:section title="Stilling" >
<htmlb:dropdownListBox id="formstilling" tooltip="Stilling" selection="Stilling">
<% loop at lt_tab into w_tab.
<htmlb:listBoxItem key="<%= sy-index %>" value="<%= w_tab-name %>" />
<% endloop. %>
</htmlb:dropdownListBox>
</hcmlso:section>
And in the OnInputProcessing i've added the following:
call method request->get_form_fields
changing
fields = i_fields.
I get all the fields, including "formstilling", but it always contain the value '1'. and not the content selected...
I'm new to BSP and would appreciate any input..
best regards B
some thing wrong with the code for population of listbox item. remove sy-index and use sy-tabix. and see how it works.
<hcmlso:section title="Stilling" >
<htmlb:dropdownListBox id="formstilling" tooltip="Stilling" selection="Stilling">
<% loop at lt_tab into w_tab.
<htmlb:listBoxItem key="<%= sy-tabix %>" value="<%= w_tab-name %>" />
<% endloop. %>
</htmlb:dropdownListBox>
</hcmlso:section>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
data: O_DATA TYPE REF TO CL_HTMLB_INPUTFIELD.
O_DATA ?= CL_HTMLB_MANAGER=>GET_DATA(
REQUEST = REQUEST
NAME = 'inputfield'
ID = 'id' ).
IF O_DATA->VALUE IS not INITIAL.
L_value = O_data->value. "this is key
ENDIF.
now read the internal table with the key and get the value.
in your case key is record index, but generally the key will be different than table record index. so read the internal table with key and get the value. in your case you simply use read table index = selectedkey will be enough.
Ok, so it's not possible to get the value selected in the dropdown directly in 'OnInputProcessing'?
I will have to use the index to get the selected line. My only problem with this is that the internal table is only available in the layout.
I could define the internal table in the page attributes, but it seems i cant define 'Type table of' here. So how will I access the internal table?
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.