private void displayInactiveParentAndChild(BalanceActivities item) { GenForm.gridActivitiesRow row = form.gridActivities().getRows().newRow(); row.setValue(item.getParent()); row.setColActivities(item.getParent()); row.setExpanded(true); GenForm.gridActivitiesRow rowChild = row.getRows().newRow(); rowChild.setColActivities(item); rowChild.setColSelected(true); }
void populateActivitiesGrid(BalanceActivitiesCollection balActivitiesColl) { BalanceActivitiesCollection coll = balActivitiesColl; BalanceActivitiesCollection collInactive = new BalanceActivitiesCollection(); GenForm.gridActivitiesRow row = null; for(int i=0;i<coll.size();i++) { int r=0; for (r=0; r<form.gridActivities().getAllRows().length; r++) { row = form.gridActivities().getAllRows()[r]; if(coll.get(i).equals(row.getColActivities())) { row.setValue(coll.get(i)); row.setColActivities(coll.get(i)); row.setColSelected(true); break; } } if(r == form.gridActivities().getAllRows().length) { collInactive.add(coll.get(i)); } } //inactive record handling boolean inactiveParentAndChild = true; BalanceActivities bal = null; BalanceActivities balParent = null; for(int i=0;i<collInactive.size();i++) { bal = collInactive.get(i); balParent = bal.getParent(); if(balParent != null) { GenForm.gridActivitiesRow rowChild = null; int j=0; for(j=0;j<form.gridActivities().getRows().size();j++) { row = form.gridActivities().getRows().get(j); if(row.getColActivities().equals(balParent)) { rowChild = row.getRows().newRow(); rowChild.setValue(bal); rowChild.setColActivities(bal); rowChild.setColSelected(true); inactiveParentAndChild = false; break; } } if(inactiveParentAndChild == true) displayInactiveParentAndChild(bal); if(j == form.gridActivities().getAllRows().length) { row = row.getRows().newRow(); row.setValue(bal); row.setColActivities(bal); row.setColSelected(true); } } else { //display inactive parent row = form.gridActivities().getRows().newRow(); row.setValue(bal); row.setColActivities(bal); row.setColSelected(true); } } }