on 02-12-2008 7:14 AM
It is possible to have a line break in a table view column header (in a web dynpro abap tableview element)?
In other words, can I have a table view column header which is several lines high?
In 7.01 WDA table columns have a new boolean property called headerTextWrapping. If you set this, the column header will wrap automatically based upon the width of the column. This is especially nice when used with the resizable property (which lets the user drag and drop the column boards to resize the column).
This same property is exposed for the ALV as well.
data l_column type ref to cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
data l_header type ref to cl_salv_wd_column_header.
l_header = l_column->get_header( ).
l_header->set_header_text_wrapping( abap_true ).
l_column->set_resizable( abap_true ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Other Workaround:
I've done that in WDJ because customer needed wrapping in column header.
it's a bit dirty but the user can't see the cheat:
- instead of using one table with a header line which has n wrapping, you need to use two tables
- first table is the header, second is the data table
- both tables col width must be equal and hard coded, in px or somehting like that, no content padding!
- both tables do not have a column header
- fist table has text views with wrapping on and text bound to context.
looks quite nice, I even used it for column groups fake, but sometimes it can be a pain in the arse when it comes to inconsistent col widths
regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
interesting question. I don't think that this is possible as the table header is only allowed to contain an element of type caption (CL_WD_CAPTION) which
can only display unformatted text and icons.
As workaround you could use group columns (CL_WD_TABLE_COLUMN_GROUP), where each group column contains one column.
~Silke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.