cancel
Showing results for 
Search instead for 
Did you mean: 

Adding row in table using loop

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

thanks it solve my purpose but i am not able to reward u points i could not see points screen

Former Member
0 Kudos

Hemant,

Can u see the 4 radio buttons below my username(Left side)?

If now can u find any Star button after my name? then click on the star button or points section to reward me.

Thanks,

Sanjeev