cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in displaying a node value in a table ui element

Former Member
0 Kudos

Hi Experts,

I have a node which is bound to a table ui element.

ParentNode

-


item

-


flag

But I want only those elements to be displayed which have flag true.

Right now all the elements in the node are displayed.

How do I achieve this?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

If u want to use only one node, then after adding the elements to that node, u can delete the elements which is having the values false as follows

for(int i=0;i<Parentnode.size();i++)

{

parEl=Parentnode.getParentElementAt(i);

if(parEl.getFlag()==false)

{

Parentnode.removeElement(parEl);

}

}

Regards

Fahad Hamsa

Former Member
0 Kudos

Hi,

Create another node with same structure.

Bind the table to to the above created node.

In the Init() method ..populate the new node.

for(int i=0;i<PartneNode.size;i++)

{

if(flag==true)

{

Create an element of new node and set the values

}

}

Thanks,Anil

Former Member
0 Kudos

Hi Anil,

Thanks for replying.

Is there no way I can achieve this with just 1 node.

Thanks

Former Member
0 Kudos

Populate the node in such a way that node contains only "true" values.

Thanks,Anilkumar

Former Member
0 Kudos

The first time, I display the node values, value for flag for all the items is true.

The problem is that once I display the node values on the page, the user has the ability to change the flag value to false (by pressing delete button). So, then I dont want to display this item in the table.

But I cannot do a removeelement on the node here, as I need this element's value at the end while saving the data in the bapi which is done once the user does all adds and removes of items.

Can you please help.

Thanks

Former Member
0 Kudos

Hi,

There is no way to fulfill your requirement with single node. You have to use two nodes. Also you have to keep track on which element you have deleted.

Create one more node with same elements.

If you want to copy all values from one node to another then use given below method:

WDCopyService.copyElements(<source node>,<target node>);

Regards,

Bhavik