Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java @ 1289:d59dcaf52796
Improved error handling if no calculation result data was found.
flys-client/trunk@2879 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 04 Oct 2011 07:55:43 +0000 |
parents | 39acba4b5f0b |
children | e88cd17b3420 |
comparison
equal
deleted
inserted
replaced
1288:17bff7b27052 | 1289:d59dcaf52796 |
---|---|
114 * This method sets the data to a dynmic table. | 114 * This method sets the data to a dynmic table. |
115 * | 115 * |
116 * @param list List if String[] containing the data. | 116 * @param list List if String[] containing the data. |
117 */ | 117 */ |
118 public void setData(List list) { | 118 public void setData(List list) { |
119 String[] header = (String[])list.get(0); | 119 if (list == null || list.size() < 2) { |
120 dataTable.setEmptyMessage(MESSAGES.error_no_calc_result()); | |
121 return; | |
122 } | |
123 | |
124 String[] header = (String[])list.get(0); | |
120 String[] firstValues = (String[])list.get(1); | 125 String[] firstValues = (String[])list.get(1); |
126 | |
121 ListGridField[] fields = new ListGridField[header.length]; | 127 ListGridField[] fields = new ListGridField[header.length]; |
122 for(int i = 0; i < header.length; i++) { | 128 for(int i = 0; i < header.length; i++) { |
123 ListGridField f = new ListGridField(String.valueOf(i)); | 129 ListGridField f = new ListGridField(String.valueOf(i)); |
124 fields[i] = f; | 130 fields[i] = f; |
125 f.setTitle(header[i]); | 131 f.setTitle(header[i]); |