Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java @ 6133:3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 30 May 2013 15:08:29 +0200 |
parents | 0b9f0d37fe6e |
children | 21d92d54303e |
comparison
equal
deleted
inserted
replaced
6132:766cba02ae4a | 6133:3ff2a4317167 |
---|---|
53 | 53 |
54 /** The message class that provides i18n strings.*/ | 54 /** The message class that provides i18n strings.*/ |
55 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); | 55 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); |
56 | 56 |
57 /** The module checkboxes.*/ | 57 /** The module checkboxes.*/ |
58 protected RadioGroupItem radio; | 58 protected static RadioGroupItem radio; |
59 | 59 |
60 /** */ | 60 /** */ |
61 protected Module[] modules; | 61 protected Module[] modules; |
62 | 62 |
63 /** The ModuleService used to retrieve the available modules of a user.*/ | 63 /** The ModuleService used to retrieve the available modules of a user.*/ |
108 * @return the module selection combined with the river selection. | 108 * @return the module selection combined with the river selection. |
109 */ | 109 */ |
110 @Override | 110 @Override |
111 public Canvas create(DataList data) { | 111 public Canvas create(DataList data) { |
112 GWT.log("ModuleSelection - create()"); | 112 GWT.log("ModuleSelection - create()"); |
113 createCallback(); | |
113 VLayout newLayout = new VLayout(); | 114 VLayout newLayout = new VLayout(); |
114 newLayout.setMembersMargin(10); | 115 newLayout.setMembersMargin(10); |
115 newLayout.setAlign(VerticalAlignment.TOP); | 116 newLayout.setAlign(VerticalAlignment.TOP); |
116 Canvas moduleSelection = createWidget(); | 117 Canvas moduleSelection = createWidget(); |
117 | 118 |
234 } | 235 } |
235 | 236 |
236 public void setRivers(Map<String, HLayout> rivers) { | 237 public void setRivers(Map<String, HLayout> rivers) { |
237 this.rivers = rivers; | 238 this.rivers = rivers; |
238 } | 239 } |
240 | |
241 private native void createCallback() /*-{ | |
242 $wnd.getModule = @org.dive4elements.river.client.client.ui.ModuleSelection::getSelectedModule(); | |
243 }-*/; | |
244 | |
245 private static String getSelectedModule() { | |
246 GWT.log("selected: " + radio.getValueAsString()); | |
247 return radio.getValueAsString(); | |
248 } | |
239 } | 249 } |
240 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 250 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |