Bri Prebilic Cole

GUI -- Bug fixes - TableModel displays empty cell instead of causing NPE if no v…

…alue is given. Sort icons and direction are reset when view is destroyed.

Change-Id: Ib56527e4d523fabf846ffb9f948a6ead99280a4b
......@@ -246,7 +246,6 @@ public class TableModel {
* @return self, for chaining
*/
public Row cell(String columnId, Object value) {
checkNotNull(value, "Must supply some value");
checkId(columnId);
cells.put(columnId, value);
return this;
......
......@@ -112,12 +112,6 @@ public class TableModelTest {
tm.addRow().cell(ZOO, 2);
}
@Test(expected = NullPointerException.class)
public void rowNullValue() {
tm = new TableModel(FOO, BAR);
tm.addRow().cell(FOO, null);
}
@Test
public void simpleRow() {
tm = new TableModel(FOO, BAR);
......
......@@ -133,7 +133,7 @@
};
}
function resetSortIcons() {
function resetSort() {
if (currCol.div) {
sortIconAPI.sortNone(currCol.div);
}
......@@ -219,7 +219,7 @@
sortIconAPI = is.sortIcons();
return {
resetSortIcons: resetSortIcons
resetSort: resetSort
};
}]);
......
......@@ -63,7 +63,7 @@
function refresh() {
$log.debug('Refreshing ' + root + ' page');
ts.resetSortIcons();
ts.resetSort();
sortCb();
}
o.scope.refresh = refresh;
......@@ -74,6 +74,7 @@
// Cleanup on destroyed scope
o.scope.$on('$destroy', function () {
wss.unbindHandlers(handlers);
ts.resetSort();
});
sortCb();
......