cancel
Showing results for 
Search instead for 
Did you mean: 

Select all in table element

Former Member
0 Kudos

Hello all,

I created a table element which contains a column of check boxes.

I want to add to my table an option to check/uncheck all the check boxes.

I already created the events but I dont know how to call the events I created using the table?

Thanks in advance,

Tomer

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Tomer,

you haven't said how your gui should look like. For example you can add two buttons ("select all" and "Unselect all") for this task. Now you add two actions, one for each button. Add the actions as eventtarget in the properties of the buttons. And in the event-methods of the actions you write your code to select/deselect the checkboxes, like


public void onActionSelectAll(...) {
    for (int i = 0; i < wdContext.nodeMyTableDataSource().size(); i++) {
        wdContext.nodeMyTableDataSource().getMyTableDataSourceElementAt(i).setMyCheckboxAttribute(true);
    }
}

public void onActionUnselectAll(...) {
    for (int i = 0; i < wdContext.nodeMyTableDataSource().size(); i++) {
        wdContext.nodeMyTableDataSource().getMyTableDataSourceElementAt(i).setMyCheckboxAttribute(false);
    }
}

HTH,

Frank

Former Member
0 Kudos

Hi,

I already wrote the actions for select/unselect.

my problem is that I want to somehow call these actions from within the table.

can I somehow place a button or a link to action in the column header?

I saw that there is a select/unselect all rows button embeded in the table(top lef corner) but I wasnt able to connect this button to any events...

thanks,

Tomer

Former Member
0 Kudos

You can use a toolbar in/above the table (in outline of the view select table-element and choose "Insert toolbar"). Now add two buttons in the toolbar and use your actions in the "onAction"-events of the buttons.

cu

Frank

Former Member
0 Kudos

ok, I think this is what I was looking for...

Thanks!

Tomer

Former Member
0 Kudos

I don't understand why you don't just use the built-in "select all" functionality.

Armin

Former Member
0 Kudos

Does java web dynpro have a build-in select-all/deselect-alll function?

Normally we need some efford to add select-all/deselect-alll button...

Former Member
0 Kudos

Yes it has (don't know exactly since which release). See the left upper corner of the Table UI element. There is a menu with this functionality.

Armin

Former Member
0 Kudos

In SAP Service Market website, we can see the left upper corner existing in some pages, that's right.

But when I tried to insert UI element Table, the left upper corner did not be generated automatic.

And I could not find a property related to the function, so the way I used is add 2 button and write some codes to set all table row element selected.

I don't think the left upper corner is made up by java web dynpro. (Maybe by ABAP web dynpro or BSP/HTMLB? )

Former Member
0 Kudos

As I said this new functionality does not exist in all releases. It is a pure client-side functionality (provided by the Unfied Rendering framework which is used by Web Dynpro for its HTML implementation). There is no API or property to control it, it is just there (depending on the table's selection mode).

Armin