cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro Table Footer

Former Member
0 Kudos

Hi All,

I need to impliment Select All functionality for first visible rows. But it should select only visible rows in table, lead select is not available in the table. if any footer button pressed means no methods are availble to control the table rows and getting the current visible rows.

I am working in EP 6.0 SP 22 level.

Regards,

Narayana.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think you can use this approach:

Create a Property, VisibleRows, Int type;

Create a Property, FirstVisibleRow, Int type;

Bind both to each Table's relative property (VisibleRows and FirstVisibleRow) - You will need to assign initial values for them in wdDoInit or somewhere else.

Whenever you press your "Select All" button, the method to be implemented should look something like this:


int visibleRows = wdContext.getVisibleRows();
int firstVisibleRow = wdContext.getFirstVisibleRow();
int offsetSelection = firstVisibleRow + visibleRows;
int tableSize = wdContext.nodeDataSource().size();

if (offsetSelection > tableSize)
  offsetSelection = tableSize;

for (int i = firstVisibleRow; i < offsetSelection; i++) {
  // Execute the Selection of Each element in here..
}

Hope it helps,

Daniel

Former Member
0 Kudos

Hi,

My requirement is select all for first visible rows only in the table. My visible rows are 10. if I press any footer button I dont have the control on table rows which are currently visible in the table.

I need to to know which rows are currently visible in the table.

regards

Narayana

Former Member
0 Kudos

Hi Narayana,

we cannot control the footer element of the table as per WD framework . So as suggested by Daniel , You have to create a "select all " action button and put the mentioed code there.

Now select the rows from footer element , and then press "select all button" they will all get selected.

Regards

Poonam Sharma

Former Member
0 Kudos

Hi,

There's no "Action" that you can put your piece of code for the Footer elements of a Table. What you could do is, go thru the source code and check for any raised event that you could intercept and subscribe your own "method". Otherwise, you could use wdDoModifyView, however, I'm not sure if this method is called after an interaction with the Table Pagination, you need to check.

Using wdModifyView you can always "compare" what was the "firstVisibleRow" before and currently. (As I assume the Context will be already updated with the new value) - That would demand another variable for the previous roundtrip.

Hope it helps,

Daniel

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Narayana,

As suggested, you cannot trigger an action on select of next and previous buttons within the footer of the table. Therefore,

You will have to trigger your event on click of a button say "Select All". Follow the follwing steps to complete your functinality.

1. Create a Node Vn_Node1 and its attributes say Va_Attr1, Va_Attr2.... in the context of the view controller.

2. Bind Vn_Node1 in DataSource Property of the Table and Create Binding to the attributes of the Vn_Node1 to create columns in the table. Set the selection mode property of the table as MultiNoLead.

3. Create attributes Va_VisibleRowCount and Va_FirstVisibRow of the type int and bind it to the table properties VisibleRowCount and FirstVisibleRow respectively.

4. Create elements of node Vn_Node1 in the wdDoInit of the View Controller along with the following lines of code.

wdContext.currentContextElement().setVa_FirstVisibRow(0);

wdContext.currentContextElement().setVa_VisibleRowCount(5);

5. Create a button "Select All" below the table or wherever you wish and create an action for the button. In the action of the button put the following lines of code to get the first visible row of the table and select all visible elements of the table together without clearing of the pre-selected rows.

int firVisiRw = wdContext.currentContextElement().getVa_FirstVisibRow();

int visiRwCnt = wdContext.currentContextElement().getVa_VisibleRowCount();

for(int i=firVisiRw; i<(firVisiRw + visiRwCnt);i++){

wdContext.nodeVn_Colleges().setSelected(i , true);

}

I would like you not the use the wdDoModify hook method as it will strike performance considerable. Hope it helps.

Regards,

Tushar Sinha,

Infosys,

Hyderabad