cancel
Showing results for 
Search instead for 
Did you mean: 

How to display rows from index 1 to all in a table

Former Member
0 Kudos

Hi,

I am facing a problem please help me.

I created a node in context with cardinality 1..n so that there will always be a element present for that node.

From one view i am providing data to this node and adding new blank element to this node.

I binded a table from view to this node so that it is displaying all the rows with a blank row at the start.

Now i want to display all the elements of that node except that blank first element in to a table

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi!

to display all the rows set the property visible rowcount and you can invalidate that elemnt to remove first blank row .

Answers (6)

Answers (6)

Former Member
0 Kudos

I want to have a empty element in the node so that the form with UI elements bound to this node can fill the inputs and the same node was connected to the table which shows that blank row in the table so to avoid that blank row in table, OnPlug event of that view containing that table i deleted that element with wdContext.nodeEmployee().removeElementAt(0); and after coming out of this view in the OnAction method added the same blank element.

Former Member
0 Kudos
former_member205363
Contributor
0 Kudos

Hi,

While adding elements to the Node start the loop with 1 not from 0.

Former Member
0 Kudos

Hi,

just change the cardinality of the node to "0...n " which is bind to the table where you want no blank space.

Regards,

ramesh

Former Member
0 Kudos

Hi,

There are many ways to do this, one simple way is just create another node(dummy) with same attributes and just copy the elements from original node (from row index 1). Finally bind the dummy node to the table.

For example say if (ABC) is your original node then create another copynode(DEF) with same attributes and copy the elements from ABC to DEF using the following code

for(int i=1;i<wdContext.nodeABC().size();i++)

{

IPrivate<<viewname>>.DEFelement ele = wdContext.createDEFelement();

ele.set<<Attribute>>(wdContext.nodeABC().getABCElementAt(i).get<<Attributename>>);

wdContext.nodeDEF().addElement(ele);

}

Hope this will solve your problem. Revert me if you need any clarifications

Regards

Raghu

Former Member
0 Kudos

Hi Amol,

You can invalidate the node before and then add the elements from the second table or you can remove the blank element from the node.

you can use the following code to remove an element


int listSize = wdContext.node<Node Name>().size();
		
if(listSize > 0) 
{
for(int i = listSize - 1; i >= 0; --i)
{
wdContext.node<Node Name>().removeElement(wdContext.node<Node Name>().getElementAt(i));
}
}

or use the following code to invalidate the node.


 wdContext.node<Node Name>().invalidate();