on 09-21-2010 5:47 AM
Hi,
Need help and advice on the Table Element
1) What happen is after i execute the webdynpro the page and rows selection is selected based on my last selection, for e.g if i had select page 2 , after i execute again the page its go to the page 2. Not to the page 1.
2) How to set the table to be first page and first row ?
Thanks for your help
Brgds,
Badz
Check the method SET_FIRST_VISIBLE_ROW of class CL_WD_TABLE, or alternatively you can bind the same property of table to some contex attribute of type I and set it to 1.
Regards
Manas Dua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I try to use the method but there is error " Access via 'NULL' object reference not possible. "
below is my code snippet.
data: obj_table type ref to cl_wd_table,
elview TYPE REF TO if_wd_view,
lr_column type ref to cl_wd_table_column,
lr_column1 type ref to cl_wd_table_column.
obj_table->SET_FIRST_VISIBLE_ROW( '1' ).
wd_this->fire_op_tomain_plg(
).
Hi,
you are getting the dump because the reference obj_table is initial.
So before you call SET_FIRST_VISIBLE_ROW() , you have to get the table instance using somthing like this.
obj_table ?= view->get_element(ID = '<table_id>').
IF obj_table IS NOT INITIAL.
obj_table->SET_FIRST_VISIBLE_ROW( '1' ).
ENDIF.
The above code is written assuming that you will be coding in WDDOMODIFY() method.
Thanks,
Aditya.
Hi,
Since you are writing the code in a handler , "view" will not be available (as it is available only in WDDOMODIFY()).
What you can do is , create a view controller attribute of type IF_WD_VIEW (say current_view ) and assign the value of "view" in WDDOMODIFY view to current_view as ,
wd_this->current_view = view.
and the access the same in your handler using the following code.
wd_this->current_view.
Thanks,
aditya.
the key is
obj_table->SET_FIRST_VISIBLE_ROW( '0' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try using methods GET_FIRST_VISIBLE_ROW and SET_FIRST_VISIBLE_ROW in class CL_WD_TABLE?
Say, get the value (returning parameter) from GET_FIRST_VISIBLE_ROW in action event that reloads the page, and set it to a local variable or context attribute. Use the same in method call to SET_FIRST_VISIBLE_ROW in modify view method.
You can try binding an attribute of type I to firstVisibleRow, as per this statement from help:
If the firstVisibleRow lies outside of the existing data records, then the first visible row is recalculated internally so that as many rows as possible are visible at the end of the data set. The value however is not written back to the UI element.If the row is actually available in the data records, but the following data records are not sufficient to fill all the rows, empty rows are displayed for the missing data records. The first visible row is not corrected in this case.
This property, which does not have to be bound, can be changed by the client.See also Properties Used in MultiPane or TablePopin
Best regards,
Chinnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes all the syntax give highlighted the first row , but on the display.. it showed row number one
please refer below picture..
after user click submit
http://img529.imageshack.us/i/firstrow.png/
after user click back and submit again, it point to row2 and row1 not displayed
http://img213.imageshack.us/i/secondrow.png/
thanks guys
You know that you really should adjust UI element properties directly outside of WDDOMODIFYVIEW. Capturing the View object and doing so is forbidden because it can cause problems with the phase model. Do so at your own risk.
Furthermore it is really unnecessary. Instead just bind the firstVisibleRow property of the table to a context attribute. You can then adjust this context attribute via normal context APIs at any time. Manipulation of UI elment properties via context binding is very much the recommended approach.
Hi,
Get the table reference from the view. And use method set_First_visible_Row by passing index as 1.
With Regards,
Shridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.