on 10-03-2011 7:20 PM
Hi all,
With drag and drop a user can select UI elements from a UI area (source), drag them from the source, and drop them into another UI element area,While we drop an element it should get expand(that node).How to auto expand?
Thanks,
Kiran
Hello Kiran,
it depends on the target ui element. If your target UI element is Hierachical table, then in the ondrop event, you can set the Expanded property value to abap_true ( via context attribute binding)
BR, Saravanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kiran,
why are you setting a the is_leaf = abap_true? if the node is leaf then it means that there no child elements. So you can't expand that node. So in your case if the node is having child elements then you need to set is_Leaf to abap_false and is_expanded to abap_true for that context element node.
BR, Saravanan
Here is the test code:
lo_nd_table_data_source = wd_context->get_child_node( name = wd_this->wdctx_table_data_source ).
lo_nd_table_data_source->get_static_attributes_table( IMPORTING table = lt_table_data_source ).
"Read Dummy Table
lo_nd_table_data_source->get_static_attributes_table( IMPORTING table = it_table_data_source ).
CONCATENATE ls_airline_info-carrid ls_airline_info-connid ls_airline_info-fldate INTO ls_table_data_source-row_key.
ls_table_data_source-parent_row_key = ls_airline_info-carrid.
ls_table_data_source-is_leaf = abap_false.
ls_table_data_source-expanded = abap_true.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_table_data_source.
LOOP AT it_table_data_source INTO wa_table_data_source WHERE carrid = ls_airline_info-carrid
and connid = ls_airline_info-connid
and fldate = ls_airline_info-fldate.
ls_table_data_source-connid = ls_airline_info-connid.
ls_table_data_source-fldate = ls_airline_info-fldate.
ls_table_data_source-PRICE = wa_table_data_source-PRICE.
ls_table_data_source-CURRENCY = wa_table_data_source-CURRENCY.
.
"Select all data to the new dummy table structure.
"Move one row of the table to ls_table_data_cource correspondingle.
APPEND ls_table_data_source TO lt_table_data_source.
DELETE ADJACENT DUPLICATES FROM lt_table_data_source.
ENDLOOP.
lo_nd_table_data_source->invalidate( ). "Clear the table data
lo_nd_table_data_source->bind_table( lt_table_data_source ). "Refresh new data
Thanks,
Kiran
Hello Kiran,
I think delete adjacent will delete the newly inserted row because the order of the newly inserted row is after the actual row.
before appending the ls_table_data_source to lt_table_data_source better delete the already existing record from lt_table_data_source.
or you can go with field symbols and irectly change the value. in this case append is not required
field-symbols: <wa_table_data_source> like line of it_table_data_source.
loop at it_table_source assigning <wa_table_data_source> where...
<wa_table_data_source>-is_leaf = abap_false
<wa_table_data_source>-is_expanded = abap_true.
endloop.
Br, Saravanan
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
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.