| CODENOTIFIER | HelpYou are not signed inSign in |
Project: gwt-ext
Revision: 1820
Author: mlim1972
Date: 05 Sep 2008 03:11:15
Changes:Issue 404. Overwrite methods to remove lingering labels when calling removeAll() or clear()
Files:| ... | ...@@ -154,4 +154,40 @@ | |
| 154 | 154 | public void setLegend(String legend) throws IllegalStateException { |
| 155 | 155 | setAttribute("legend", legend, true); |
| 156 | 156 | } |
| 157 | ||
| 158 | /** | |
| 159 | * Overwriting this method so that the labels are taken care of. This | |
| 160 | * method will call the super method when the removeAll is called | |
| 161 | */ | |
| 162 | public void removeAll(){ | |
| 163 | super.removeAll(); | |
| 164 | removeLabels(false); | |
| 165 | } | |
| 166 | ||
| 167 | /** | |
| 168 | * Overwriting this method so that the labels are taken care of. This | |
| 169 | * method will call the super method when the removeAll is called | |
| 170 | */ | |
| 171 | public void removeAll(boolean autoDestroy){ | |
| 172 | super.removeAll(autoDestroy); | |
| 173 | removeLabels(autoDestroy); | |
| 174 | } | |
| 175 | ||
| 176 | /** | |
| 177 | * Private method that will remove the labels in the fieldSet after | |
| 178 | * the field itself has been removed. | |
| 179 | * @param autoDestroy to destroy the label or not. | |
| 180 | */ | |
| 181 | private native void removeLabels(boolean autoDestroy) /*-{ | |
| 182 | var fieldset = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()(); | |
| 183 | if(autoDestroy){ | |
| 184 | fieldset.getEl().update(""); | |
| 185 | } | |
| 186 | else{ | |
| 187 | // don't know what to do since the superclass just hides the fields... | |
| 188 | // for now, it's the same as autoDestroy but if someone has a better | |
| 189 | // idea, they we should change here!!! | |
| 190 | fieldset.getEl().update(""); | |
| 191 | } | |
| 192 | }-*/; | |
| 157 | 193 | } |