on 02-01-2007 8:27 PM
Hi All,
Problem:
I am adding row in a table dynamically using loop. When i am adding withoug loop just on the click of button using set and get method then rows are added correcly. But when same thing i do in a loop , loop fails and it only returns first value. Please let me know how to proceed
Code Snippet:
IPublicEVComp.IEmployeeNode node = wdContext.nodeEmployee();
IPublicEVComp.IEmployeeElement elem = wdContext.nodeEmployee().createEmployeeElement();
try
{
//msg.reportWarning("warning1");
ReadIndicatorXML readxml = new ReadIndicatorXML();
Indicator ind = new Indicator();
al = readxml.indicatorList();
msg.reportSuccess(al.size() +"");
for (int i =0 ;i<al.size() ;i++)
{
ind = (Indicator)al.get(i);
elem.setFN(ind.getName());
elem.setLn(ind.getCurrent());
elem.setImage("bullet.gif");
node.addElement(elem);
}
msg.reportSuccess(test);
}
catch(Exception e)
{
msg.reportSuccess("error" + al.size() +"");
}
Ways:
1)Shall i use calculated attribute , if yes then how
2)Or else i can use it without with normal get & set in a loop
I m sure this must be an easy exercise if you would like to replicate,but not for me anymore.
Regards
Hemant
Hi Hemant,
Try by creating element inside loop.
like:
for (int i =0 ;i<al.size() ;i++)
{
IPublicEVComp.IEmployeeElement elem = wdContext.nodeEmployee().createEmployeeElement();
ind = (Indicator)al.get(i);
elem.setFN(ind.getName());
elem.setLn(ind.getCurrent());
elem.setImage("bullet.gif");
node.addElement(elem);
}
Thanks,
Sanjeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.