on 07-24-2007 9:27 AM
how to hide a table column for eg tablename: custTable column id: col_custid
pls advice
Message was edited by:
yzme yzme
hi yzme,
Check the cardinality of Node "Visibility".If it is 0..1 or 0..n you have to initialized it.
For 0..n node use code inside wdDoInit.
wdContext.node<node_name>().addElement(wdContext.create<node_name>Element());
For 0..1 node use code inside wdDoInit.
wdContext.node<node_name>().bind(wdContext.create<node_name>Element());
Or you can make node (Visibility) cardinality either 1..1 or 1..n
Without creating any element you cant set the value to the context node attribute like.
wdContext.currentVisibilityElement().setD29Visible(WDVisibility.VISIBLE);
wdContext.currentVisibilityElement().setD30Visible(WDVisibility.NONE);
wdContext.currentVisibilityElement().setD31Visible(WDVisibility.NONE);
If you initialize the node (Visibility) you will not get null pointer exception.
But if you create a table using the node Visibility it will not hide your table column. It will add a record in the table like.
-
VISIBLE NONE NONE
-
To hide the table column [by id] use the code inside wdDoModifyView
-
IWDTableColumn custidtableCol = (IWDTableColumn)view.getElement("col_custid");
custidtableCol.setVisible(WDVisibility.NONE);
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use Visibility Options for this.
Create a Value attribute of type Visibility which will be available in the Dictionary.
Bind IWDTableColumn.visible property to context attribute of (DDIC) type Visibility. Set attribute value to WDVisibility.NONE to hide column.
Once it is binded , you can change the Visibility behaviour by coding wherever u want :
wdcontext.currentContextElent().setVisibility("NONE");
Regards,
Santhosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i hit null pointer exception
what wrong with my code
Visibility
-d29Visible
-d30Visible
-d31Visible
wdContext.currentVisibilityElement().setD29Visible(WDVisibility.VISIBLE);
wdContext.currentVisibilityElement().setD30Visible(WDVisibility.NONE);
wdContext.currentVisibilityElement().setD31Visible(WDVisibility.NONE);
Message was edited by:
yzme yzme
Hi,
IWDTableColumn CustIDCol = (IWDTableColumn)view.getElement("col_custid");
CustIDCol.setVisible(WDVisibility.NONE); // To hide column
CustIDCol.setVisible(WDVisibility.VISIBLE);//To view column
Node : Visibility
Attributes : d29Visible, d30Visible, d31Visible
wdContext.currentVisibilityElement().setd29Visible(WDVisibility.VISIBLE);
wdContext.currentVisibilityElement().setd30Visible(WDVisibility.NONE);
wdContext.currentVisibilityElement().setd31Visible(WDVisibility.NONE);
Attributes : d29Visible, d30Visible, d31Visible should be <b>com.sap.ide.webdynpro .uielementdefinition .Visibility</b> of type.
Regards
Vasundhara
Hi Yzme,
Bind IWDTableColumn.visible property to context attribute of (DDIC) type Visibility.
Set attribute value to WDVisibility.NONE to hide column.
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You first create an attribute say saveView of type com.sap.ide.webdynpro.uielementdefinitions.Visibility
Now go to the property of the element col_custid you want to hide and bind the visible property to the above attribute saveView .
Now depending upon your condition you may hide your element
by the code in view
wdContext.currentContextElement().setSaveView(WDVisibility.NONE)
regards
Sunit
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 |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.