cancel
Showing results for 
Search instead for 
Did you mean: 

Table

Former Member
0 Kudos

Hi

How to make Table column empty.?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

It depends.

Assume the cell editor for the table column is a TextView and the type of the corresponding context attribute A is "string".

Let "Rows" be the data source node. To clear all entries in the table column bound to attribute A:


for (int i = 0; i < wdContext.nodeRows().size(); ++i)
{
  IRowsElement row = wdContext.nodeRows().getRowsElementAt(i);
  row.setA(null); /* or "" */
}

Armin

Former Member
0 Kudos

Hi

Itz working, but the probelm is column having null values, I have to make it empty

It should be like no values in the table.

Thanks

Former Member
0 Kudos

What do you mean with "null values"?

Which cell editor and which context attribute type are you using?

Armin

Former Member
0 Kudos

Hi

In my application I have to select the date to display values in table from DateNavigator, for fisrt selction i am getting the right display when i select the second time the values are concatinating to the fisrt selected values....

well here i made those first selected values to null when i select the date again istead of first selected values i am getting empty rows then the second selcted values.?

Here i have to delete empty rows too..?

Thanks

Former Member
0 Kudos

Please post the code that updates the table after selecting the date from the DateNavigator.

Armin

Former Member
0 Kudos

Hi

This is the code that updates the table:

IPrivateCalenderView.ILocElement emt;

for(int i=0;i<size*size;i++)

{

if(loc1<i> != null)

{

emt = wdContext.createLocElement();

emt.setLocation(loc1<i>);

wdContext.nodeLoc().addElement(emt);

}

}

Former Member
0 Kudos

Don't you clear the node before adding new elements?

You can do this with

wdContext.nodeLoc().bind((Collection)null);

Armin

Former Member
0 Kudos

Hi

If i write that line before adding elements itz giving error:

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

at java.util.ArrayList.RangeCheck(ArrayList.java:507)

at java.util.ArrayList.get(ArrayList.java:324)

at com.sap.tc.webdynpro.progmodel.context.Node$ElementList.getElement(Node.java:2084)

at com.sap.tc.webdynpro.progmodel.context.Node.getElementAtInternal(Node.java:672)

Former Member
0 Kudos

Hi

Got it

Thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

You need to navigate each element of the node and set the what ever the value you want to set.

//Context Node to which table data soure attached is "MyNode" 
for(int i = 0; i< wdContext.nodeMyNode().size(); i++) {
	IWDNodeElement element = wdContext.nodeMyNode().getElementAt(i);
//"attruteName": Column data source; Refer IWDNodeElement Java Doc.
	element.setAttributeValue("attrubuteName", "");
	}

Sorry, I didn't see Armin's response

Message was edited by: Kranthi