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
Showing
4 changed files
with
4 additions
and
10 deletions
... | @@ -246,7 +246,6 @@ public class TableModel { | ... | @@ -246,7 +246,6 @@ public class TableModel { |
246 | * @return self, for chaining | 246 | * @return self, for chaining |
247 | */ | 247 | */ |
248 | public Row cell(String columnId, Object value) { | 248 | public Row cell(String columnId, Object value) { |
249 | - checkNotNull(value, "Must supply some value"); | ||
250 | checkId(columnId); | 249 | checkId(columnId); |
251 | cells.put(columnId, value); | 250 | cells.put(columnId, value); |
252 | return this; | 251 | return this; | ... | ... |
... | @@ -112,12 +112,6 @@ public class TableModelTest { | ... | @@ -112,12 +112,6 @@ public class TableModelTest { |
112 | tm.addRow().cell(ZOO, 2); | 112 | tm.addRow().cell(ZOO, 2); |
113 | } | 113 | } |
114 | 114 | ||
115 | - @Test(expected = NullPointerException.class) | ||
116 | - public void rowNullValue() { | ||
117 | - tm = new TableModel(FOO, BAR); | ||
118 | - tm.addRow().cell(FOO, null); | ||
119 | - } | ||
120 | - | ||
121 | @Test | 115 | @Test |
122 | public void simpleRow() { | 116 | public void simpleRow() { |
123 | tm = new TableModel(FOO, BAR); | 117 | tm = new TableModel(FOO, BAR); | ... | ... |
... | @@ -133,7 +133,7 @@ | ... | @@ -133,7 +133,7 @@ |
133 | }; | 133 | }; |
134 | } | 134 | } |
135 | 135 | ||
136 | - function resetSortIcons() { | 136 | + function resetSort() { |
137 | if (currCol.div) { | 137 | if (currCol.div) { |
138 | sortIconAPI.sortNone(currCol.div); | 138 | sortIconAPI.sortNone(currCol.div); |
139 | } | 139 | } |
... | @@ -219,7 +219,7 @@ | ... | @@ -219,7 +219,7 @@ |
219 | sortIconAPI = is.sortIcons(); | 219 | sortIconAPI = is.sortIcons(); |
220 | 220 | ||
221 | return { | 221 | return { |
222 | - resetSortIcons: resetSortIcons | 222 | + resetSort: resetSort |
223 | }; | 223 | }; |
224 | }]); | 224 | }]); |
225 | 225 | ... | ... |
... | @@ -63,7 +63,7 @@ | ... | @@ -63,7 +63,7 @@ |
63 | 63 | ||
64 | function refresh() { | 64 | function refresh() { |
65 | $log.debug('Refreshing ' + root + ' page'); | 65 | $log.debug('Refreshing ' + root + ' page'); |
66 | - ts.resetSortIcons(); | 66 | + ts.resetSort(); |
67 | sortCb(); | 67 | sortCb(); |
68 | } | 68 | } |
69 | o.scope.refresh = refresh; | 69 | o.scope.refresh = refresh; |
... | @@ -74,6 +74,7 @@ | ... | @@ -74,6 +74,7 @@ |
74 | // Cleanup on destroyed scope | 74 | // Cleanup on destroyed scope |
75 | o.scope.$on('$destroy', function () { | 75 | o.scope.$on('$destroy', function () { |
76 | wss.unbindHandlers(handlers); | 76 | wss.unbindHandlers(handlers); |
77 | + ts.resetSort(); | ||
77 | }); | 78 | }); |
78 | 79 | ||
79 | sortCb(); | 80 | sortCb(); | ... | ... |
-
Please register or login to post a comment