hi, my component in webtop implements IControlListener interface.the compoenent includes a datagrid, with 50 rows page size.onControlInitialized method is called by the system many times(1181 times).i have notes on the code can you please have a look?is it possible a program enters both if and else?
public void onControlInitialized(Form arg0, Control arg1) {
Datagrid dg2 = (Datagrid) getControl("dgTaskList", Datagrid.class);
List<DatagridRow> rows = dg2.getDatagridRows();
for (int i = 0; i < rows.size(); i++) {
DatagridRow dgr = rows.get(i);
Iterator it = dgr.getContainedControls();
Checkbox c = null;
Label l = null;
if (it.hasNext()) {
c = (Checkbox) it.next();// checkboxı al
}
if (it.hasNext()) {
it.next();// bir tane es geç
}
if (it.hasNext()) {
l = (Label) it.next();// return valueyu al
}
if(c!=null){
if (l != null && l.getLabel().equals("0")) {
//System.out.println(l.getLabel() + " visibleolacak");
c.setVisible(true);
} else if (l != null && !l.getLabel().equals("0")) {
c.setVisible(false); ***********************************1 it enters here
//System.out.println("invisibleolacak:" + l.getLabel());
} else {
System.out.println("l null");********************2 then it enters here is it possible?
break;
}
}
else{
System.out.println("c null");
}
}
}
Regards.