on 05-26-2014 2:13 PM
Hi,
I am new in web dynpro programming and I need help with getting a row selected when a tab from the column gets selected with the cursor.
For example if I click on the sales org. id tab then entire row should get selected as in the second image.
I found some information about the lead selection, but that only brings the manually selected line.
How can I select the row automatically?
Any help is much appreciated.
Best regards,
Elena
Hi,
There are no onFocus events in Web Dynpro ABAP like in java script. Only way you could do is, create an Event onEnter for the Input fied ( Sales Org) and set the lead selection in the onEnter event. User must press Enter.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
Thank you for your reply. The thing is the Input Field(Sales Org) already has an onEnter event. The one that brings up the sales organizations. Perhaps I could include in the same method also the lead selection.
Do you have any ideea how the syntax would look like in this case?
Thank you.
Elena
You can try using the method set_lead_selection_index( lv_index ) where lv_index should be the number of the row that you want to get marked.
DATA: lo_nd_node TYPE REF TO if_wd_context_node,
lo_el_node TYPE REF TO if_wd_context_element,
lv_index TYPE i.
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
CALL METHOD lo_nd_node->set_lead_selection_index( lv_index ).
Hi Elena,
You will be able to get the context_element reference of current row in the event OnEnter.
Try the below code:
data lo_element type ref to if_wd_context_element.
lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
if lo_element is bound.
lo_element->set_selected( flag = abap_true ).
endif.
Note: this selects the current row on which the OnEnter event occurred. if you keep pressing ENTER key on multiple rows, you would see that all those rows gets selected. For making context node to accept multiple row selection ... you should set the SELECTION : 0....n in the context node of the table. otherwise, run time error occurs
if your requirement is to select only one row at any case, then try the below code
data lo_element type ref to if_wd_context_element.
data lo_node type ref to if_wd_context_node.
lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
if lo_element is bound.
lv_index = lo_element->get_index( ).
lo_node = lo_element->get_node( ).
lo_node->SET_LEAD_SELECTION_INDEX( index = lv_index ).
endif.
Hope this helps you.
Regards,
Rama
Message was edited by: Ramakrishnappa Gangappa
Hi Guys,
I wanted to thank you all for the support. The information was really helpful.
Btw the logic works fine with wd_assist->get_sales_org_data( context_element ).
The thing was that only some certain sales org were triggering that method and I was using wrong testing data.
Cheers and have a great day ahead!
Best regards,
Elena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you All for your support.
I have added the following syntax:
data: lo_element type ref to if_wd_context_element,
lo_node type ref to if_wd_context_node,
lv_index TYPE i.
lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
if lo_element is bound.
lv_index = lo_element->get_index( ).
lo_node = lo_element->get_node( ).
lo_node->SET_LEAD_SELECTION_INDEX( index = lv_index ).
endif.
It does select each row at the enter action but now it's not bringing up the sales org data.
wd_assist->get_sales_org_data( context_element ).
This line of code seems to be bypassed somehow.
Any suggestions?
I already tried changing the position where this gets called but still the line is skipped.
Best regards,
Elena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.