on 06-25-2009 12:05 PM
Hi all,
I have one dropdownkey UI Element in the view.
I want to add the database table field values to the dropdown key ..
how to get this
Hi,
Below are the steps to create dropdownbykey.
1. Create a UI element type dropdownbykey in layout
2. create a context NODE1 and add attribute ATTR1 type DATS(what ever can be the type) under it
3. Bind this context attribute ATTR1 to ui element
4. Write below code to WDINIT() method of view or component controller to set possible values for dropdown
data: value type WDR_CONTEXT_ATTR_VALUE,
value_set type WDR_CONTEXT_ATTR_VALUE_LIST.
data node_info type ref to if_wd_context_node_info.
node_info = wd_context->get_node_info( ).
"here replace node1 with your node
node_info = node_info->get_child_node( wd_this->wdctx_node1 ).
* Get the values from DB here
select * from SPFLI into lt_tab.
loop at lt_tab into wa_tab.
value-value = wa_tab-conn_id "what ever the field
value-text = 'text'. "text to appear in UI
insert value into table value_set.
endloop.
"this method set the value set to dropdown
node_info->set_attribute_value_set( name = 'ATTR1' value_set = value_set ).
Note: just to show example i have written a DB query here, but you should use API for that.
Regards,
Manne
Edited by: Raja Sekhar Manne on Jun 25, 2009 1:21 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Set the Lead Selection property for the Context Node under which your Context Attribute is there which is binded to Dropdown by key.
Go to Context -> Context NOde-> properties of Context node(down)
Set the lead selection property for that node.
I hope you have made the attribute which is binded to Drop down by key under a Node.
If you havent, plz declare node. Under that node, a attribute and bind this attritbute to the Dropdown.
Edited by: Saurav Mago on Jun 25, 2009 5:43 PM
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.