cancel
Showing results for 
Search instead for 
Did you mean: 

Vertical Table?

Former Member
0 Kudos

Hi,

Can we convert our Web Dynpro table to Vertical Table which shows the row vertically? The requirement is to view the records vertically for comparison of different attributes. As the number of attributes are around 50 or so it doesn't look good to have normal table.

Any idea, how to achieve this?

Regards,

Mausam

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Mausam,

This is not the simplest task but it is possible (at least in theory) in NW04s.

First you have to make transposition of original node to new one. Every attribute becomes a node element, every attribute value becomes attribute.

For example, original node structure:


- Cars
  -- Model (String)
  -- Vendor (String)
  -- Speed (int)
  -- Color (String, enum)

...becomes:


-- CarsComparision
   -- AttrName 
   -- CellVariantName
   -- Model1 (String)
   -- Model2 (String)
   -- ...
   -- ModelN (String, N is number of elements in Cars node)
   -- Vendor1 (String)
   -- Vendor2 (String)
   -- ...
   -- VendorN (String, N is number of elements in Cars node) 
   -- Speed1 (int)
   -- Speed2 (int)
   -- ...
   -- SpeedN (int, N is number of elements in Cars node) 
   -- ...

Now you have to create elements in CarsComparision. Create element. Set its AttributeName, for example "Vendor". Iterate over all elements in Cars and set attributes Vendor1, Vendor2, ...VendorN for every corresponding car. Repeat for other attributes. This will be a pair of nested loops -- outer one by attribute names in Cars, inner by Cars elements.

At this point you have data ready for table display. Now you have to create table and table columns. Number of columns will be N+1 -- first one is attribute name, N is number of elements. For every column you must create as many CellVarinats as number of attributes in Car. By the way, in corresponding outer loop above you have to assign CellVariantName attribute properly.

If you read the post till this line you are probably understand that solution is very complex and requires dynamic programming. It is.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

GREEEEEEEEEEEEAAAAAAAAAAAAAAAAAAATTTTTTTTTT,

Thank you.

I'm a big fan of yours since I started Web Dynpro programming. That sure is a solution to my problem.

As I wont be knowing the possible number of columns ( no of items to compare ) at design time, I will have to create the context at runtime only. This adds 1 more step in dynamic programming. It seems a big develoment effort. Fortunately I have got all textfields and its only for Viewing data ( all TextViews )

I did not exactly get the point of CellVariant here..can you please explain that in a bit more detail.

Regards,

Mausam

Former Member
0 Kudos

Mausam,

Thank you for kind words.

<i>As I wont be knowing the possible number of columns ( no of items to compare ) at design time, I will have to create the context at runtime only.</i>

<b>True</b>

<i>It seems a big develoment effort</i>

<b>Absolutely true.</b>

I faced the same situation several times, though I have limited number of items to compare. So instead of creating reusable component in way I described, I prefer creating several "forms" with GridLayout. Just because of complexity faced

<i>I did not exactly get the point of CellVariant here..can you please explain that in a bit more detail.

</i>

See, in your table you have rows as attributes. So in one column you must have cell editors bound to data of different types:

- Vendor line has InputField bound to text attribute;

- Vendor line has InputField bound to text attribute;

- Speed line has InputField bound to integer attribute;

- Color line has DropDownByKey bound to text attribute;

Even you have only TextViews, every TextView in column is bound to different attribute. So you need different CellVariants, evry variant has separate TextView, every TextView is bound to own attribute.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net