Hello all
I need to sum the values of the tabular data in listview. I tried like this
but it doesnot work. How should i do it. I need to get the totalCredit added
from the list but its always = 0 , where am i wrong, please help
private int totalCredit = 0;
public AccountPanel(String id, String user) {
super(id);
try {
accountList = Bill.listUserWise(user);
} catch (SQLException e) {
}
final ListView data = new ListView("rows", accountList) {
public void populateItem(final ListItem item) {
Bill bill = (Bill) item.getModelObject();
item.add(new Label("date", bill.getName()));
String creditValue = String.valueOf(bill.getCredit());
totalCredit = totalCredit + bill.getCredit();
item.add(new Label("credit", creditValue));
}
};
add(data);
add(new Label("cr", String.valueOf(totalCredit)));
thanks
tsuresh
--
View this message in context:
http://www.nabble.com/Add-list-item-values-tp17078026p17078026.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]