cancel
Showing results for 
Search instead for 
Did you mean: 

Hide the filter row in the table

Former Member
0 Kudos

Hi,

I've got a requirement to add to my table a toggle button, which would hide and display the filter row.

Is that possible?

Thanks in advance,

Julia.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Julia,

It is very much possible.

Follow the following steps:

1. Create a table toolbar, and add a button to this tool bar.

2. associate some action to this table toolbar button (say "toggleFilter").

3. In the implementation of the view, declare a static boolean variable (begin others section)

public static boolean toggleFilter = false;

4. in the action of "toggleFilter" write the code

toggleFilter = toggleFilter?false:true;

5. In the wdModifyView method write the following code

IWDTable iwdt = (IWDTable)view.getElement("Table1");

if(toggleFilter) {

iwdt.setOnFilter(null);

}

else {

iwdt.setOnFilter(wdThis.wdGetAPI().getAction("filter"));

}

Hoping that this helps.

Thanks and regards

Radha Krishna .B

Answers (2)

Answers (2)

Former Member
0 Kudos

Julia,

After Radha's post I can only say... Just forget my previous reply )

His solution is much simplier.

VS

Former Member
0 Kudos

If he replaces the static variable by a context attribute, I agree

Armin

Former Member
0 Kudos

Hi,

I agree with Armin too . . . i was trying for a quicker solution

we should reduce the use of static variables and use context attributes.

RK

Former Member
0 Kudos

Julia,

Yes, this is possible.

In brief words you have to:

1. Create some flag attribute in context (int with 3 values 0 -- no changes, 1 -- show, 2 -- hide filter)

2. In action handler for toggle set this flag to either 1 or 2.

3. In wdDoModifyView check if flag is not equal to zero.

4. If check in [ 3 ] is true, then iterate over all table columns and bind "filter" property of column either to necessary attribute or to null (unbind).

5. After [ 4 ] set flag to zero in wdDoModifyView.

Note that toggle state and flag shoud be independend attributes.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com