on 05-14-2007 5:42 AM
hi
i have table and i want to add new column that calculate the deference between two other columns.
i create the column and i could loop in the content of the table but i could not update the entries in the new columns.
regards
Said
Hai Mohammed,
You just create a table with coloumns a,b and c(a-b).In the component controller context for 'c' you set the property calculated as true,then you will get two methods getter and setter.In the getter method you just return the difference like this.
public int getdiff()
{
return(obj.getA()-obj.getB());
}
you will get the result.
Regards
Sathish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
did u try creating a node for the same? create a value node for the table with 3 value attrbutes, one for each column. then in the init method of that view, just create 3 arrays, setting the value in the first two array. then make use of this code for setting the difference in the thrid column
IPrivateUIView.I<valuenode> tab_node = wdContext.node<valuenode>();
for(int i= 0; i<6;i++)
{
IPrivate<view>.I<valueelement> num_ele = tab_node.create<valueelement>();
num_ele.set<valueattribute1>(num1<i>);
num_ele.set<valueattribute2>(num2<i>);
num_ele.set<diffvalueattribute>(num1<i>-num2<i>);
wdContext.node<valuenode>().addElement(num_ele);
}
this will surely work .
Do let me know the results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
Create a table with coloumns bind the datanode--Data(a,b,diff attributes).
ArrayList al =new ArrayList();
for(int i=0;i<wdContext.nodeData().size();i++){
IprivateXXView.IdataElement ele=wdContext.createDataElement();
ele.setA(wdContext.nodeData().getDataElement(i).getA());
ele.setB(wdContext.nodeData().getDataElement(i).getB());
ele.setDiff(wdContext.nodeData().getDataElement(i).getB()-wdContext.nodeData().getDataElement(i).getA());
al.add(ele);
}
wdContext.nodeData().bind(al);
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.