on 2007 May 15 11:57 PM
Hi all,
I am using a drop down list box with 2 possible values in a page fragment. My issue is that when the user selects the 2nd value in the drop down the event is triggered but the dropdown shows the 1st value in the top. I would like to show the value picked by the user in the top of the list. Please let me know if we can achive this functionality.
Thanks in advance.
Below is the code i am using.
<htmlb:dropdownListBox id = "LIST"
nameOfKeyColumn = "NAME"
nameOfValueColumn = "VALUE"
width = "300"
selection = "<%= doc_type %>"
onSelect = "DDLB1Event" >
<htmlb:listBoxItem key = "IC"
value = "<%= otr(YP_HRPA/DOC_TYPE1) %>" />
<htmlb:listBoxItem key = "PM"
value = "<%= otr(YP_HRPA/DOC_TYPE2) %>" />
</htmlb:dropdownListBox>
<%
CALL METHOD REQUEST->GET_FORM_FIELD
EXPORTING
NAME = 'LIST'
RECEIVING
VALUE = doc_type.
Request clarification before answering.
Yes we can achieve this. But you need to use internal table in dropdownlist as show below:
<b>Onintialization</b>
entry-name = 'IC'. entry-value = 'IC Text'.
APPEND entry TO itab.
entry-name = 'PM'. entry-value = 'PM Text'.
APPEND entry TO itab.
<b>Layout</b>
<htmlb:dropdownListBox id = "LIST"
nameOfKeyColumn = "NAME"
nameOfValueColumn = "VALUE"
width = "300"
selection = "<%= doc_type %>"
onSelect = "DDLB1Event"
table = "<%= itab %>" />
<b>Page attribute:</b>
entry TYPE IHTTPNVP
itab TYPE TIHTTPNVP
<b>OnINputprocessing:</b>
CALL METHOD REQUEST->GET_FORM_FIELD
EXPORTING
NAME = 'LIST'
RECEIVING
VALUE = doc_type.
delete itab where name = doc_type. " This will remove selected entry from Itab.
if doc_type = 'IC'
entry-name = 'IC'. entry-value = 'IC Text'.
else.
entry-name = 'PM'. entry-value = 'PM Text'.
endif.
insert entry to itab index 1.
<i>* Reward each useful answer</i>
Raja T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Raja for the help full suggestions.
I am having the code for the drop down in a page gragment layout and i added the itab and entry in the page attributes of the page with flow logic thats calling the page fragmnet. But when i try to use the itab in page fragment i get an error saying that the itab doesnot exist. Cant we use the variables and page attributes of a page with flow logic in a page fragment?
If your issue is resolved, Reward each useful answer and close the thread pls...
Raja T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
30 | |
10 | |
8 | |
8 | |
7 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.