on 01-28-2008 4:01 PM
Hello,
I have a WD Table where I have implemented the Filter capabilities as explaned in the Tutorial
"Generic Web Dynpro Java Table Filter" and it works fine.
I would like now to add a Filter button in the Table Toolbar where I 'll be able to enable/disable the
the Filter capabilities and to Show/hide the added Filtering Row acording to the button state.
Could you please help on this issue.
Thanks in Advance
Best regards,
Harry
The filter button and filter fields are only displayed if the "filterValue" property of the corresponding table columns are bound to some context attribute.
So you could realize this activate/deactivate filter by adding/removing the context binding for these properties.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Armin,
in the wdDoModifyView method of my View
I have bind dynamicaly the filter values of my table columns as you said see below
if(filterButtonChecked){
IWDTableColumn tableColumnOfFPNsystemName = (IWDTableColumn)view.getElement("producerName");
tableColumnOfFPNsystemName.bindFilterValue ("FpnSystemsMngmt.SLDProducersDataFilter.producerName");
IWDTableColumn tableColumnOfFPNsystemId = (IWDTableColumn)view.getElement("producerID");
tableColumnOfFPNsystemId.bindFilterValue("FpnSystemsMngmt.SLDProducersDataFilter.producerID");
}
else{
IWDTableColumn tableColumnOfFPNsystemName = (IWDTableColumn)view.getElement("producerName");
tableColumnOfFPNsystemName.bindFilterValue("");
IWDTableColumn tableColumnOfFPNsystemId = (IWDTableColumn)view.getElement("producerID");
tableColumnOfFPNsystemId.bindFilterValue("");
}
Unfortunaltly I can still see the Blank fielter field on top of those columns.
Did I miss something.
Thanks & regards
Harry
Hi Armin,
I did as you advise me to do but it works only for the first time.
I mean that in my code I have designed the behavior to be such that when the table is initialy loaded
the filter is disabled. Until now now problem and the filter columns are not visible.
After first click on my filter button
public void onActionFilterDisplayFilter(){
if(ButtonChecked){
wdContext.currentSLDProducersDataFilterElement().setfilterButtonChecked(true);
}
else{
wdContext.currentSLDProducersDataFilterElement().setfilterButtonChecked(true);
}
}
wdDoModifyView(){
boolean filterButtonChecked = wdContext.currentSLDProducersDataFilterElement().getEnableFilter();
IWDTableColumn tableColumnOfFPNsystemName = (IWDTableColumn)view.getElement("producerName");
tableColumnOfFPNsystemName.bindFilterValue(filterButtonChecked ? "FpnSystemsMngmt.SLDProducersDataFilter.producerName" : null);
IWDTableColumn tableColumnOfFPNsystemId = (IWDTableColumn)view.getElement("producerID");
tableColumnOfFPNsystemId.bindFilterValue(filterButtonChecked ? "FpnSystemsMngmt.SLDProducersDataFilter.producerID" : null);
}
It works only
Hi Armin,
please ignore the previous notification.
I did as you advise me to do but it works only for the first time.
I mean that in my code I have designed the behavior to be such that when the table is initialy loaded
the filter is disabled. Until now now problem and the filter columns are not visible.
After first click on my filter button the Filter columns appears as expected.
But then repeating the operation does not Hide the Filter columns anymore , no matters with Filter button state.
public void onActionFilterDisplayFilter(){
if(ButtonChecked){
wdContext.currentSLDProducersDataFilterElement().setfilterButtonChecked(true);
}
else{
wdContext.currentSLDProducersDataFilterElement().setfilterButtonChecked(false);
}
}
wdDoModifyView(){
boolean filterButtonChecked = wdContext.currentSLDProducersDataFilterElement().filterButtonChecked;
IWDTableColumn tableColumnOfFPNsystemName = (IWDTableColumn)view.getElement("producerName");
tableColumnOfFPNsystemName.bindFilterValue(filterButtonChecked ? "FpnSystemsMngmt.SLDProducersDataFilter.producerName" : null);
IWDTableColumn tableColumnOfFPNsystemId = (IWDTableColumn)view.getElement("producerID");
tableColumnOfFPNsystemId.bindFilterValue(filterButtonChecked ? "FpnSystemsMngmt.SLDProducersDataFilter.producerID" : null);
}
Can you please help.
Thanks again,
harry
Maybe you should not execute the code in wdDoModifyView() every time but only when the corresponding action has been triggered. This can be controlled by an additional flag "FilterDisplayToggled" or something like that. This flag would be set to true everytime the button is clicked.
In wdDoModifyView() you would then have something like
if ( wdContext.currentContextElement().getFilterDisplayToggled() )
{
wdContext.currentContextElement().setFilterDisplayToggled(false);
// .. as before
}
Another possibility (that hides all filter fields) would be to just disable the filter action itself inside the button handler.
Armin
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.