on 06-06-2007 4:40 AM
There is a tree like below:
Tree
Treenode1
tree_item1
tree_item2
Treenode2
tree_item3
tree_item4
tree_item5
how can I get the value of tree_item1,2,3... after they were been pressed?? Thanks in advance.
Hi,
What exactly do you mean by When they were pressed. lead selected or do you have any link.
If you want to get the lead selected element, simply you can use node->get_lead_selection( ) which returns you element and using get_static_attributes( ) method you can get the values of that element.
If you want ot get the value when you press some link, have an action handler for that link and in the action handler method you can get the current element using wdevent's get_context_element method ( wdevent->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ) which returns element. From element you can get values using get_static_attributes or get_attribute methods.).
Thanks,
Prasahnth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks,Prasahnth, in this tree, there is one leaf name 'SFLIGHT', after click this leaf, value 'SFLIGHT' will be got and to be showed with ALV control.
I just need to get the value 'SFLIGHT', that is the table will be output by ALV later.
could you please show some example codes of this? thanks once more.
Thanks all, I had got the value by below codes:
data parent_element TYPE REF TO if_wd_context_element.
parent_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
parent_element->get_attribute( EXPORTING name = 'VALUE' IMPORTING value = tablename ).
then the table name is 'SFLIGHT", just what I need.
Thanks so much for your kind help!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Define an event handler for the OnAction event of the tree. The method would have wdevent as an importing parameter. You can use the method call wdevent->get_string('ID'), which will return the UI element ID of the item that has been clicked. Else you can use wdevent->get_context_element( ).
Refer to the webdynpro component WDR_TEST_EVENTS that has various types of trees. Hope this helps.
Regards,
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.