cancel
Showing results for 
Search instead for 
Did you mean: 

Retreiving individual row of a table

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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....

Former Member
0 Kudos

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

Former Member
0 Kudos

Ya...i tried that also but still it didn't work......what is happening is if the condition for the last row is met it displays the link and displays for all.....

Thanks,

Shikhil

Former Member
0 Kudos

Hu Shikhil,

Copy/Paste your implementation of what you are doing the check it out.

Cheers

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

"must be under the data source node of the table"

Armin

Former Member
0 Kudos

I did exactly as you said and it worked like a charm....

Thanks..

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Thanks for the reply....i created a CellVariant of type TableStandardCell....then i created a Editor of type LinkToAction in that which i want....but i am not able to create a second Editor in that....

Regards,

Shikhil

Former Member
0 Kudos

Insert a second Cell Variant