cancel
Showing results for 
Search instead for 
Did you mean: 

Tip for working with Table Column Width

Former Member
0 Kudos

Hi,

I just want to give a suggestion for working with table column width. It's nothing magic, but I'm happy that I now found a solution for my problem. Maye it's interesting for some of you.

The problem:

I have a lot of data, which is only to be read. So I decided to put TextViews as TableCellRenderer for each column. The effect is, that each column is always as long as the text. So the table width grows through the right screen border and horizontically scrolling is necessary. That's not nice.

The workaround:

Instead of using TextViews take InputFields, set the property readOnly = true and the property width to a desired value (e.g. 100px).

It looks like TextView but the text is cutted at the end of the specified width and the table width has no undefined growing.

Best regards,

Marcus

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Even though i agree with your method, the result is NOT a pretty sight.

The reason being, the result is a table having rows with varying widths. Believe me, it looks very bad.

I have comeup with another solution, although it is a bit tedious.

Restrict the string(whose value is set into the context), to about 20 or 30. convert it into a hyperlink. OnAction of the hyperlink will create a small popup window, which inturn displays the entire stirng.

It is a long process, but the end result is that...the tables look even and good, esp if the user only wants to view the tables.

Former Member
0 Kudos

I don't know who you are replying to, but in both cases you can achieve strict table width.

your idea works fine but you spend a lot of time clicking (and developing), aren't you?

Former Member
0 Kudos

Gentelmen,

It's good time to upgrade your NW -- in NW04s (probably in latest NW04 stacks as well) there is an option to define scrollable columns in Table UI control. So you may declare some columns fixed, and some scrollable. Sure, all headers will stay in sync this way

Btw, seems that Markus suggested workaround for bug rather then solution. In my environment TextView value is truncated correctly if width for table or column is set.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi Friends,

Can anyone please explain the usage of scrollable columns in WebDynpro Java tables and how it could help in wrapping the text in column headers?

My original requirement is as follows,

In a table I need to dynamically set the width of the columns according to the width configured by the user in some other view. All the columns of the table are dynamically rendered.

Now what happens is when the user sets the width of the column to a rather low value, say 15 pixels, then the column is displayed like

________________________

Supplier Catalog Name

_______________________

Sheila

Catalog

Name

Dropdown

_______________________

As you can see it looks rather odd.

Supplier Catalog Name is the header of the column and I use IWDCaption for header.

Sheila Catalog Name Dropdown is the value of a particular row at the specified column. I am using a TextView as the TableCellEditor.

I think what is happening here is that the framework wraps the text in the TextView according to the width specified (15px) and then the column width is extended because it can not accommodate the text (Supplier Catalog Name ) of the column header.

We are using SAP NetWeaver Development Studio 7.0.12 as the IDE.

Any help would be of great advantage.

Thanks

Amit

Former Member
0 Kudos

more tips regarding tables:

I read a few threads about table headers and the terrible way they are dealt by the framework. The problem with table headers is, that they are not wrapped. so if you have tables with a lot of cols in it, the table grows pretty large to the right side of the screen.

or, you have cols with only checkboxes in it but a large header text.

or, you have different text length in l18n apps

Anyway this has been discussed before...

The solution is dirty but in my opinion the only one looking good for the user, any comments are appreciated

I use two tables to display one:

first table works as "header". it consists of one row, no header, no footer, no lead select. is read-only and alternating (more control regarding design). It has text views in it which are wrapped.

second table is the "data" table. it has no header, footer if desired, only input fields (see reason by Marcus above).

now you apply width in px (why the heck is it not possible to use pt or any other css value by the way?) to every header col, until you think that it is enough for the header text AND for the content. don't forget the lead selection cell.

now you apply roughly the same width to the second table columns, until you have simulated a table with header.

one more thing for better design: use "padless" cell design, so theres no gap between the two tables. take both tables in a transparent container and apply more width in px than neccessary(no stretching) but do not specify the width of the table(that becomes a real mess), let the table structure the cols itself from left to right!

it is pretty nasty to find out the pixel width of the second table, but it looks pretty well in the end.

if you want screenshots, you can pm me, I guess

cheers

stefan