on 03-20-2007 10:59 PM
Hi All,
I am developing a web dynpro application (NW2004).
I want to hide some columns in a table when user clicks a button.
Can anyone help me how to do this?
Thanks
Bind IWDTableColumn.<i>visible</i> property to context attribute of (DDIC) type Visibility. Set attribute value to WDVisibility.NONE to hide column.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Armin.
I followed your instructions and it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi..
it is very simple and straightforward.
Just follow the following steps:
1...create a context value attribute(in that view which contains the table) of type IWDVisibility.
2...Now go to the properties of the column of the table which u want to dynamically make inviible.
3...in the visibility property of that column, map it with the context that u created in step1.
4...Now, if u want the visibility to be set dynamically on click of a button, create an OnAction action event for that button & in the implementation of that OnAction, set the visibility of the column by setting the value of tha context created in step1.
For making it invisible on clicking, type the following:
wdcontext.currentcontextelement.set<context name>(WDVisibility.NONE);
For making it visible on clicking, type the following:
wdcontext.currentcontextelement.set<context name>(WDVisibility.VISIBLE);
5...<b>FINALLY, you need to initialize the visibility of the column. you can do that by going to the wdDoInit() method of that view, and set the visibility to either visible or invisible depending upon your requirement</b>
you might need to organise your sources for the WDVisibility class to get imported.
for this, either rightclick in <i>implementationsourcesorganise imports.</i>
or else just type: <i>import com.sap.tc.webdynpro.progmodel.api.WDVisibility;</i>
Please reward some points if you find this answer useful..:-)
Message was edited by:
Hanoz Tarapore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
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.