on 04-17-2009 12:38 PM
Hi Experts,
i have implemented the TableFilter using the blog see the link
[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60d5b593-ba83-2910-28a9-a7a7c7f5996f]
i wish to ADD a Button ( Show Filter ) such that when application starts table DOES NOT show the filter ROW by default. Ony if user wishes to make a search he should click on Show Filter Button and then filter row should start to appear.
Its kind of dynamic event assignment and de-assignment required on click of button
Any guidance helpfull.
Greetings
Prashant
Parveh Help and some common sense
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prashant,
For achieving this you need to do some run time checks and some dynamic coding.
Please try this:
1) Create a attribute in context node of datatype String and in wdDoModify() write this code in firstTime check:
if(firstTime){
IWDToolBarButton ttb = (IWDToolBarButton)view.getElement("ID_Of_Button");
ttb.setText("Show Filter");
}
2) On the onToggle event of the button write this code:
IWDTableColumn col1 = (IWDTableColumn)view.getElement("Name_Of_Column1");
IWDTableColumn col2= (IWDTableColumn)view.getElement("Name_Of_Column2");
IWDTableColumn col3 = (IWDTableColumn)view.getElement("Name_Of_Column3");
IWDToolBarButton ttb = (IWDToolBarButton)view.getElement("ID_Of_Button");
String value = ttb.getText();
if(value.equalsIgnoreCase("Show Filter"))
{
ttb.setText("Hide Filter");
ttb.setTooltip("Hide Filter");
col1.bindFilterValue(wdContext.node<Filter_Node>().getNodeInfo().getAttribute("Attribute_for_Filter_For_Column1"));
col2.bindFilterValue(wdContext.node<Filter_Node>().getNodeInfo().getAttribute("Attribute_for_Filter_For_Column2"));
col3.bindFilterValue(wdContext.node<Filter_Node>().getNodeInfo().getAttribute("Attribute_for_Filter_For_Column3"));
}
else
{
ttb.setText("Show Filter");
ttb.setTooltip("Show Filter");
col1.bindFilterValue(wdContext.node<Filter_Node>().getNodeInfo().getAttribute(""));
col2.bindFilterValue(wdContext.node<Filter_Node>().getNodeInfo().getAttribute(""));
col3.bindFilterValue(wdContext.node<Filter_Node>().getNodeInfo().getAttribute(""));
}
I hope this helps!! Please revert abck in case you want any further help!
Thanks and Regards,
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thanks All,
Just solved the issue.
public void onActionToggleFilter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionToggleFilter(ServerEvent)
IWDView view = wdContext.currentContextElement().getView();
IWDTableColumn col1 = (IWDTableColumn)view.getElement("NAME_0");
IWDAttributeInfo attrInfo = wdContext.nodeFilterNode().getNodeInfo().getAttribute("");
col1.bindFilterValue( attrInfo);
//@@end
}
only glitch was how to access the VIEW outside the wddomodfy method so had to by pass this by creating the context attribute 'View' of type com.sap.tc.webdynpro.progmodel.api.IWDView assigning this in WDDOMODIFY and using that in my event handler.
Greetings
Prashant
Edited by: Prashant on Apr 17, 2009 4:49 PM
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.