on 11-27-2009 11:11 AM
Hi
I have added drop down by key in table as one of the column. I am getting the entries in the 'drop down by key' but unable to catch the user selected entry. I have to write a method in the 'onselect' event of that UI element.
Please help me on how we can catch the user selected value in the drop down by key?
Thanks in advance...
Regards
Rama
hi,
Just the read the attribute binded to dropdown by key in the Onselect event . It will give you key of value selected.
Use Code Wizard to read the attribute (control _ F7 ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Rama ,
proceed like this :
1 bind ur context node say cn_node to the table UI .
2 all ur columns in the table are binded to the context attributes which are under this context node
3 suppose ur dropdown is binded to a context attribute ca_attr , so this attribute shud be under the context node
cn_node
4 u can get the line selected by the user in a structure using get_stattic_attributes
use this code in OnselectEvent
DATA : lo_nd_cn_input TYPE REF TO if_wd_context_node ,
lo_el_cn_input TYPE REF TO if_wd_context_element ,
ls_cn_input TYPE wd_this->element_cn_input ,
ls_cn_input1 TYPE wd_this->element_cn_input.
* navigate from <CONTEXT> to <CN_INPUT> via lead selection
lo_nd_cn_input = wd_context->get_child_node(
name = wd_this->wdctx_cn_input ).
* get element via lead selection
lo_el_cn_input = lo_nd_cn_input->get_element( ).
* get all declared attributes
lo_el_cn_input->get_static_attributes(
IMPORTING
static_attributes = ls_cn_input ).
5 now u have got the values in the structure , so u can get the vallue selected for ur dropdown , using
the below code :
DATA : lv_dropdown type string .
lv_dropdown = ls_cn_input-ca_attr
now the variable lv_dropdown holds value . u cn use it in the method of ur view
I hope it helps
rgds,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In order to catch the user slection run over the table elements in a loop and for each
element get the value of the dropdown by it's context attribute.
hope it's help:)
Regards,
Shimon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Use this code if you want to capture the row in which drop down has been selected without lead selection of row.
data: lr_element type ref to if_wd_context_element.
DATA ls_cn_popin TYPE wd_this->element_cn_popin.
lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
get all declared attributes
lr_element->get_static_attributes(
IMPORTING
static_attributes = ls_cn_popin ).
Now from ls_cn_popin you can read the column which ever you want.
data lv type string.
lv = ls_cn_popin-dropdownColumn.
Lv would have the value .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is your dropdownbykey selected key is bound to the context attribute properly..
One more thing, does this node(ie top which the key is bound) has any empty values in drop down..
Are you using any standard DE or table to get the entries for this dropdown or are you filling them through any other means...
If you are using any standard one please provide the name of it.. Check in debugging for these values.
Regards,
Lekha.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.