on 07-13-2007 9:48 PM
Hi All
I have context with node and this is binded to a table at design time. How can I delete some of the rows from it. I tried to have below code in wdinit of view controller and doModify method. Though I am deleting rows I am able to see all records in table. Can any one suggest me solution for this
for (int i = 0; i < wdContext.nodeZdetail().size(); i++) {
IPrivateShipmentPopUpView.IZdetailElement ele=wdContext.nodeZdetail().getZdetailElementAt(i);
if(cond)
{
wdContext.nodeZdetail().removeElement(ele);
}
First, the fact that the data binding has been defined at design time has nothing to do with the content of the table. The content is always determined at runtime by the elements in the data source node.
When deleting node elements in a loop, you have to take care that the indices are stable. You can achieve this for example by looping backwards, e.g.
IWDNode node = wdContext.node<Node>();
for (int i = node.size() - 1; i >= 0; --i)
{
IWDNodeElement e = node.getElementAt(i);
node.removeElement(e);
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.