on 10-09-2009 10:25 AM
Hi,
I want to implement a logic where in i have to scroll table dynamically as soon as a 6th row is added to a table of 5 visible rows.
Can somebody help me in this regard.
Regards,
Soumya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
This code will set only 5 visible rows .
Bind the visiblerow count property of table with an attribute of type I.
Before binding the table with internal table write this code :
DESCRIBE TABLE t_selected_hcp LINES lv_visiblerow.
****** Reduce the no of visible rows *************
IF lv_visiblerow > 5.
lv_visiblerow = 5 .
ENDIF.
* navigate from <CONTEXT> to <CN_TABLEPROP> via lead selection
lo_nd_cn_tableprop = wd_context->get_child_node( name = wd_this->wdctx_cn_tableprop_pvl ).
get element via lead selection
lo_el_cn_tableprop = lo_nd_cn_tableprop->get_element( ).
IF lv_visiblerow > 0 .
get single attribute
lo_el_cn_tableprop->set_attribute(
name = `CA_VISIBLEROW_PVL`
value = lv_visiblerow ).
ELSEIF lv_visiblerow = 0 .
lo_el_cn_tableprop->set_attribute(
name = `CA_VISIBLEROW_PVL`
value = -1 ).
ENDIF.
This will make sure that only 5 rows are visible and rest you have to scroll to see.
Now if you want that out of 6 rows added to the table , last 5 rows should be visible then :
Create a Context Attribute of type I "LEAD_SELECTION" and bind this to firstVisibleRow property of table .
Write this code:
Get the number of rows in table ****
DESCRIBE TABLE it_selected_hcp1 LINES lv_count.
DATA lo_el_context TYPE REF TO if_wd_context_element.
Set the lead selection to last row *****
lo_el_context = wd_context->get_element( ).
lo_el_context->set_attribute( name = `LEAD_SELECTION` value = lv_count ).
lo_nd_cn_entertainment->set_lead_selection_index( lv_count ).
This will work.
Edited by: Saurav Mago on Oct 9, 2009 3:16 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U can set the value of firstActualRow and firstVisibleRow for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.