on 05-07-2010 7:59 AM
I've got a problem of showing values in a Drop Down Box.
I've got 1 Dropdown box, 1 button and a text field. In the text field i'm wirting a carrid for example AC.
If i press the button in the Drop down box should show the name to the corresponding carrid for example Air Canada.
this is my code till yet. But i don't see what's missing.
Maybe anybody can help?
Data: context_node type ref to if_wd_context_node.
Data: it_carriers TYPE STANDARD TABLE OF scarr,
wa_carriers LIKE LINE OF it_carriers,
wa_carrid(3) TYPE c.
context_node = wd_context->get_child_node( 'DROPDOWN_CARRIERS' ).
context_node->get_attribute( exporting Name = 'CARRID' importing value = wa_carrid ).
select * from scarr
INTO wa_carriers
WHERE carrid = wa_carrid.
APPEND wa_carriers TO it_carriers.
ENDSELECT.
context_node = wd_context->get_child_node( name = 'CARRID').
context_node->BIND_TABLE( new_items = it_carriers ).
Hi...
I'm guessing that this code is in the method handling the event of the button?
You have bound your dropdown by index texts property to the node 'CARRID' and the text field within it?
Unless you set the lead selection of the table that you have just inserted the dropdown by index doesn't know what is selected...
in the set up of your context check that the node is set to initialise lead selection.
good luck,
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Get the selected row by using code wizard and use the values of the structure whereever you want. Refer to the below code:
Suppose I have a Node NODE_OUTPUT and binded with my table UI element. We need to get the selected row (ls_node_output) in my Button UI event handler method as below:
DATA lo_nd_node_output TYPE REF TO if_wd_context_node.
DATA lo_el_node_output TYPE REF TO if_wd_context_element.
DATA ls_node_output TYPE wd_this->element_node_output.
navigate from <CONTEXT> to <NODE_OUTPUT> via lead selection
lo_nd_node_output = wd_context->get_child_node( name = wd_this->wdctx_node_output ).
get element via lead selection
lo_el_node_output = lo_nd_node_output->get_element( ).
get all declared attributes
lo_el_node_output->get_static_attributes(
IMPORTING
static_attributes = ls_node_output ).
Hi,
just bind your text field to the same node as the dropdown by index - any selection of the dropdown by index will update the lead selection of that context node - and thus the value displayed in the text field. No need for two nodes.
Sorry, having re-read you post after a weekend's gap it seems much simpler!
Chris
Hi,
whichever node you want to restrict your list of possible airlines to - bind this to both the dropdown and the text field.
There is no need for any onSelect type event or two nodes.
if you wish to populate this node using the select statement (for example during applicaition initalisaition) do so.
If at the start of the application you don't want anything selected then ensure that the node is not set to initalise lead selection.
If you want the user to be able to deselect once they have made a selection - then you will need to add a blank value to the list of possible selections.
Hope this helps....
Chris
Ensure that you didn't set any supply function on the context node which is binded with the Dropdown. And set your dropdown node binding code in the Modify view by checking that the screen is not initially installed. Use the First_time parameter of the modify view to do this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.