After the list was hidden, getField return a valid reference for a shown field, but return null for an hidden one. After the list is shown again, getField start returning a valid reference again. The behaviour should be the same for hidden and shown field
ListGrid list = new ListGrid();
ListGridField f1 = new ListGridField("a");
f1.setHidden(true);
ListGridField f2 = new ListGridField("b");
list.setFields(f1, f2);
if (list.getField("b") == null) {
System.out.println("Before hide: Field b is null");
}
if (list.getField("a") == null) {
System.out.println("Before hide: Field a is null");
}
list.show();
list.hide();
if (list.getField("b") == null) {
System.out.println("After hide: Field b is null");
}
if (list.getField("a") == null) {
System.out.println("After hide: Field a is null");
}
list.show();
if (list.getField("a") == null) {
System.out.println("After show: Field a is null");
}
ListGrid list = new ListGrid();
ListGridField f1 = new ListGridField("a");
f1.setHidden(true);
ListGridField f2 = new ListGridField("b");
list.setFields(f1, f2);
if (list.getField("b") == null) {
System.out.println("Before hide: Field b is null");
}
if (list.getField("a") == null) {
System.out.println("Before hide: Field a is null");
}
list.show();
list.hide();
if (list.getField("b") == null) {
System.out.println("After hide: Field b is null");
}
if (list.getField("a") == null) {
System.out.println("After hide: Field a is null");
}
list.show();
if (list.getField("a") == null) {
System.out.println("After show: Field a is null");
}
Comment