on 08-06-2009 1:59 PM
Hello,
I have a webdynpro application where i have a table whose values are fetched from the BAPI ......in this table i added one more column which i want to hide/display based on some conditions ...now the problem is how do i set this new column visible and not visible for each and every record ....how can i get to each row check for condition and set that column accordingly.....
Any help would be highly appreciated.
Regards,
Shikhil
I think you want to show/hide cells of that column, not the column itself, right? If that's the case, you could bind the property "visible" of the cell editor used in the additional column to some context attribute of local DDIC type "Visibility" (must be under the data source node of the table). Now set the attribute value to WDVisibility.VISIBLE or WDVisibility.NONE to show/hide the cell content.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ya...thats what i wanna do....so i created a column ...then inserted a TableCellEditor of type 'LinkToAction' in that.....binded the visible property of the LinkToAction to a context attribute of type "com.sap.ide.webdynpro.uielementdefinitions.Visibility" and made it visible/none depending on the condition at runtime.....but if the condition for the first row fails....it hides the column for all the rows......
Please help....
Hi Shikhil,
I asume that the Visibility attribute you created its inside the node you mapped to the table. Is this right?
If not, in the node your table is mapped you need to created a Vissibility attribute and everytime you iterate that node to get the condition you should set the visibility value of the current element. ie, wdContext.node<X>.current<X>Element.setLinkToActionVissibility(WDVissibility.NONE/VISIBLE);
If that's not the case please give a litle more detail..
Cheers
JV
Here it is :
for(int i=0;i<wdContext.node<X>size();i++)
{
if(String.toUpperCase().equalsIgnoreCase(wdContext.node<X>get<X>ElementAt(i).get<Attribute>()))
wdContext.node<Y>.current<Y>Element().setEditvisible(WDVisibility.VISIBLE);
else
wdContext.node<Y>.current<Y>Element().setEditvisible(WDVisibility.NONE);
}
I inserted the EditVisible value attribute inside the <Y> node which is the outernode and the <X> is the Table (Output) being retured from the BAPI.....i could not insert EditVisible in node <X> because it says " Adding Attributes is currently not supported if the node or the Model class has a dictionary structure binding...."
Regards,
Shikhil
Edited by: Shikhil Arora on Aug 6, 2009 6:52 PM
I see your point, that are model nodes...
With model nodes you can't change the structure of the node (adding attributes), you may create a value node and add value attributes like the ones on your model node, then in this new value node you can add the visibility attributes.
You would need to pass the values from the model node to the value node by iterating the model node and pasing the data for each model element to a value node element. In the value node is where you make your condition, and bind the value node to the table.
Hope it helps,
JV
Using "Cell Variant" you can use 2 cell editors on that column - one with visibilty true and the other with visibilty false.
Use the cell variant - variant key property to determine which cell editor to display.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.