cancel
Showing results for 
Search instead for 
Did you mean: 

DropdownListBox doesn't keep selected values

Former Member
0 Kudos

Greetings experts!

I am facing one problem respecting htmlb:dropdownlistbox.

In my application I have a few fields to introduce parameters and search some values. The display is like this:

|----

-


!/| (dropdown)

|----

-


!/| (dropdown)

Button

Table with results of the search

The problem I have is that both dropdowns are empty after pushing the button. ¿Is there a way to keep the selected values selected?

This is the code of one of the dropdowns:

<htmlb:dropdownListBox id = "SUBTIPO_LOG_DROP"

selection = "<%= disp_subtipo_log %>" >

<htmlb:listBoxItem key ="<%= 'BLAN'%>" value ="<%= ' '%>" />

<htmlb:listBoxItem key ="<%= 'CMAS'%>" value ="<%= 'Carga masiva'%>" />

<htmlb:listBoxItem key ="<%= 'AAUT'%>" value ="<%= 'Agrupación automática'%>" />

</htmlb:dropdownListBox>

I get the selected value using

DATA: drop_subtipo TYPE REF TO cl_htmlb_dropdownlistbox.

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

name = 'dropdownListBox'

id = 'SUBTIPO_LOG_DROP').

me->disp_subtipo_log = drop_subtipo->selection.

I have tried using combobox and using an inner table replacing the listBoxItems and got no results. I have search and didn't found anything that helps me.

Please, help me!!

Best regards.

View Entire Topic
Former Member
0 Kudos

I think the issue is simple.

Instead of assigning the value to the drop down like this:

me->disp_subtipo_log = drop_subtipo->selection.

get the the value to a variable(have this variable in page attributes):

l_variable = drop_subtipo->selection. and pass this in the layout like

<htmlb:dropdownListBox id = "SUBTIPO_LOG_DROP"

selection = "<%= l_variable %>" >

This will work.

Edited by: Gopal_Jothi on Sep 24, 2010 7:24 AM

Former Member
0 Kudos

Hello Gopal_Jothi

I don't understand how but it have solved my problem. I think that I have been doing the very same thing before, but I have declared two new variables and now it works!!!

Thank you very much!

Best regards.