Show TOC Start of Content Area

Procedure documentation Implementing Scroll Tips  Locate the document in its SAP Library structure

This example explains how to implement a scroll tip that gives a preview of the first character of the first and the last row that will be displayed when the user releases the mouse.

Prerequisites

      You have created an application with the necessary units in your Web Dynpro DC.

      You have created a context node and attributes for the table data.

      You have created a table UI element with it's containing elements as described in Implementing Tables.

Procedure

create ...

       1.      Create a node called scrollTips.

       2.      Insert to context attributes into this scrollTips node:

       startRow of type integer

       text of type String.

This graphic is explained in the accompanying text

       3.      Switch to the Outline view and insert a ScrollTipProviderinto the Table.

       4.      Bind the ScrollTipProvider's properties as follows:

       dataSource to the scrollTips node

       startRow to context attribute startRow

       text to context attribute text

Now the Properties view of the ScrollTipProvider looks like the screenshot below:

This graphic is explained in the accompanying text

       5.      If you have not already done so, open the Java Editor of you view and enter the following code:

wdDoInit()

ITableElement lastTableElement = null;

IScrollTipsNode scrollTipsNode = wdContext.nodeScrollTips();

IScrollTipsElement scrollTipsElement = null;

for (int i = 0; i < friends.length; i++) {

   ITableElement elem = wdContext.createAndAddTableElement();

   elem.setCol1(friends[i]);

   if (lastTableElement == null

         || lastTableElement.getCol1().toUpperCase().charAt(0) != elem

               .getCol1().toUpperCase().charAt(0)) {

      scrollTipsElement = scrollTipsNode

            .createAndAddScrollTipsElement();

      scrollTipsElement.setText(String.valueOf(elem.getCol1()

            .toUpperCase().charAt(0)));

      scrollTipsElement.setStartRow(i);

   }

   lastTableElement = elem;

}

You have defined a new scroll tip only if the first character has changed, but not for each row.

Result

The scroll tip shows a preview of the rows that will be displayed when the user releases the scroll bar.

preview on range to be displayed

result

This graphic is explained in the accompanying text

This graphic is explained in the accompanying text

 

End of Content Area