on 05-30-2008 11:30 AM
Hi Experts,
I am showing the records on the screen in a table .
One of the columns contains the link 'Delete' as a LinkToAction .
I want to delete this record from the table on the
screen when this 'Delete' link is pressed.
Thanks in advance.
Hi Vaibhav,
Implement the following code in the action handler for the LinkToAction click event.
Firstly, Get the selected element.
Data : node_material type ref to if_wd_context_node,
elem_material type ref to if_wd_context_element.
call method node_material->get_lead_selection
receiving
element = elem_material
.
Now, delete this element.
call method node_material->remove_element
exporting
element = elem_material
.
Thanks.
Shruti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Check this code
in the parameters above the method declare an attribute context_element type if_wd_context_element.
DATA lo_nd_rcf_edu_det TYPE REF TO if_wd_context_node.
DATA lo_el_rcf_edu_det TYPE REF TO if_wd_context_element.
DATA ls_rcf_edu_det TYPE wd_this->element_rcf_edu_det.
DATA lt_rcf_edu_det TYPE wd_this->elements_rcf_edu_det.
data ls_delete_buffer type rcf_s_cand_education_pl.
data lv_index type i.
navigate from <CONTEXT> to <RCF_EDU_DET> via lead selection
lo_nd_rcf_edu_det = wd_context->get_child_node( name = wd_this->wdctx_rcf_edu_det ).
@TODO handle non existant child
IF lo_nd_rcf_edu_det IS INITIAL.
ENDIF.
get element via lead selection
lo_el_rcf_edu_det = lo_nd_rcf_edu_det->get_element( ).
alternative access via index
lo_el_rcf_edu_det = lo_nd_rcf_edu_det->get_element( index = 1 ).
@TODO handle not set lead selection
IF lo_el_rcf_edu_det IS INITIAL.
ENDIF.
CALL METHOD context_element->get_index
receiving
my_index = lv_index.
CALL METHOD lo_nd_rcf_edu_det->get_element
EXPORTING
index = lv_index
receiving
node_element = lo_el_rcf_edu_det .
CALL METHOD lo_el_rcf_edu_det->get_static_attributes
IMPORTING
static_attributes = ls_rcf_edu_det.
ls_rcf_edu_det-operation = 'D'.
move-corresponding ls_rcf_edu_det to ls_delete_buffer.
append ls_delete_buffer to wd_comp_controller->gt_delete_buffer.
CALL METHOD lo_nd_rcf_edu_det->remove_element
EXPORTING
element = lo_el_rcf_edu_det
receiving
has_been_removed =
.
regards
chythanya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Define an action handler for the LinkToAction click event. In the event handler, get the element that was selected using the code:
element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
Then, get the reference of your context node using the code wizard (ctrl + F7). Now use the method
node->remove_element( element )
to remove the selected element. The particular row will be deleted.
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 |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.