on 10-23-2007 12:39 PM
Hello,
I am using the cell editor link_to_action in an table view. When clicking this link I would like to get the value of this specific column. I get the value of the row with:
context_element->get_static_attributes( ) and the ID of the column but not the value for example "21.05.".
thanks and regards
stefan
Hi,
As the link text displayed is attached to the text property of the link and u can only get or set the property only when u r in wddomodifyview . there is no way to get the this text in other method .u have to go with the context_element and get the desired attribute by hardcoding.. the attribute name ..
Regards
Yash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yash,
my problem is that I dont know the attribute_name. I have a row with diiferent columns:
month day1 day2 day3 day4 day5
Now the user clicks on maybe day3. I get the whole context_element and the ID.
So when the ID is "table_day1_editor" I have to get the day1 from the middle of the ID and use it at the attributename?
regards
stefan
Hi,
You can use below mentioned code in the event handler of your action.
DATA lo_nd_node TYPE REF TO if_wd_context_node.
DATA lo_el_node TYPE REF TO if_wd_context_element.
DATA ls_node TYPE wd_this->element_node.
DATA lead_selection_index TYPE i.
navigate from <CONTEXT> to <NODE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
IF ( lo_nd_node IS INITIAL ).
ENDIF.
<b>lo_el_node = wdevent->get_context_element('CONTEXT_ELEMENT').
lo_el_node->get_static_attributes( IMPORTING static_attributes = ls_node ).</b>
Now you will get the values of all the column fields of clicked row in <b>ls_node</b> structure.
Now you can take the value of the clicked column from ls_node.
Regards,
Aditya Baheti
Hi,
If you get the static attributes, it's only a matter of knowing the attribute name,
which represents the value 21,05 and do:
context_element->get_static_attributes( importing static_attributes = ls_structure ).
lv_value = ls_structure-attributename.
if the table is full of links,
do
context_element->get_attributes( exporting name = ID
importing value = lv_value
).
grtz,
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi stefan ,
Just try reading coloumn ( field / attribute ) you want .As by default lead selected rows coloumn value will come .
Take case I have simple table to name and no .And it have currently some four entries in it.To know currently clicked entry in table (i.ie Name and no. ) I will do as following
DATA lo_nd_nd_table TYPE REF TO if_wd_context_node.
DATA lo_el_nd_table TYPE REF TO if_wd_context_element.
DATA ls_nd_table TYPE wd_this->element_nd_table.
DATA : lv_name LIKE ls_nd_table-name,
lv_no LIKE ls_nd_table-no.
navigate from <CONTEXT> to <ND_TABLE> via lead selection
lo_nd_nd_table = wd_context->get_child_node( name = wd_this->wdctx_nd_table ).
@TODO handle not set lead selection
IF lo_nd_nd_table IS INITIAL.
ENDIF.
get element via lead selection
lo_el_nd_table = lo_nd_nd_table->get_element( ).
@TODO handle not set lead selection
IF lo_el_nd_table IS INITIAL.
ENDIF.
alternative access via index
lo_el_nd_table = lo_nd_nd_table->get_element( index = 1 ).
@TODO handle non existant child
IF lo_el_nd_table IS INITIAL.
ENDIF.
get single attribute
lo_el_nd_table->get_attribute(
EXPORTING
name = `NAME`
IMPORTING
value = lv_name ).
lo_el_nd_table->get_attribute(
EXPORTING
name = `No`
IMPORTING
value = lv_no ).
Please let know if u want something different .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.