on 09-23-2010 1:48 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Example
<%@page language="abap"%>
<%@page language="abap" forceEncode="html"%>
<%@extension name="htmlb" prefix="htmlb"%>
<%@extension name="bsp" prefix="bsp"%>
<htmlb:content id="content" design="classic+design2002+design2003"
controlRendering="sap" rtlAutoSwitch = "true">
<htmlb:dropdownListBox id = "mydropdownListBox1" >
<htmlb:listBoxItem key = "key_vbak" value = "vbak" />
<htmlb:listBoxItem key = "key_vbap" value = "vbap" />
</htmlb:dropdownListBox>
</htmlb:form>
</htmlb:page>
</htmlb:content>
this is in layout
and this is in event handling
DATA: data1 TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.
data1 ?= CL_HTMLB_MANAGER=>GET_DATA( request = runtime->server->request
name = 'dropdownlistbox'
id = 'mydropdownListBox1').
selection1 = radioButtongroup->selection.
case selection1.
when 'activate'.
** IF data1 IS NOT INITIAL.
selection2 = data1->selection.
case selection2 .
when 'key_vbak'.
write ur code here .
when 'key_vbap'.
write ur code here .
endcase.
** ENDIF.
hope this example helps you out...
Cheers,
bhavana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Bhavana.
Thank you for the answer.
The BSP is not MVC, is a simple BSP.
disp_subtipo_log is defined in Page Attributes tab. When I presh the button, in the event handler OnInputProccessing I am retrieving the selected item and I am able to do the search, but the dropdownlistbow appears to be empty.
The display is:
<htmlb:content design="design2003" >
<htmlb:page title="<%= otr(ZSRM_02/TT_PRINCIPAL) %>" >
<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>
</htmlb:page>
</htmlb:content>
In event handler I do not change the content of disp_subtipo_log.
¿How can I make it keep the selected value? ¿Perhaps I have to set explicitly the selected value? How could I set a value directly?
Best regards.
Hi, Bhavana!
I have tried your code and it doesn't keep the selected value. When you click on a radio button the dropdown shows the first element in it. In this case it shows vbak, even vbap is selected when I click the 'activate' radio button.
Thak you for the code, but the problem persists.
Cheers.
Hi,
Is the application with MVC or simple BSP Page, can u brief it more,
If its MVC then check it putting the break point, May be the varible which u have used is not set globally.
cheers,
Bhavana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.