Revision 4e9b68d2
Added by Andreas Kohlbecker over 4 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java | ||
---|---|---|
27 | 27 |
import org.vaadin.spring.events.EventScope; |
28 | 28 |
import org.vaadin.spring.events.annotation.EventBusListenerMethod; |
29 | 29 |
|
30 |
import com.vaadin.server.ClientConnector.DetachEvent; |
|
31 |
import com.vaadin.server.ClientConnector.DetachListener; |
|
30 | 32 |
import com.vaadin.spring.annotation.SpringComponent; |
31 | 33 |
import com.vaadin.spring.annotation.ViewScope; |
32 | 34 |
import com.vaadin.ui.AbstractField; |
... | ... | |
357 | 359 |
boolean isAddExistingNameRegistration = event.getTarget() != null && event.getTarget().equals(getView().getAddExistingNameCombobox()); |
358 | 360 |
|
359 | 361 |
TaxonNamePopupEditor popup = openPopupEditor(TaxonNamePopupEditor.class, event); |
362 |
|
|
360 | 363 |
popup.setParentEditorActionContext(event.getContext(), event.getTarget()); |
361 | 364 |
popup.withDeleteButton(!isAddExistingNameRegistration); |
362 | 365 |
TaxonNamePopupEditorConfig.configureForNomenclaturalAct(popup); |
... | ... | |
364 | 367 |
// allow saving even if the name parts are not valid |
365 | 368 |
// the user will need to fix this in a later step |
366 | 369 |
popup.disableMode(TaxonNamePopupEditorMode.VALIDATE_AGAINST_HIGHER_NAME_PART); |
370 |
getView().getAddExistingNameRegistrationButton().setEnabled(false); |
|
371 |
popup.addDetachListener(new DetachListener() { |
|
372 |
|
|
373 |
@Override |
|
374 |
public void detach(DetachEvent event) { |
|
375 |
getView().getAddExistingNameRegistrationButton().setEnabled(true); |
|
376 |
|
|
377 |
} |
|
378 |
}); |
|
367 | 379 |
} |
368 | 380 |
popup.loadInEditor(event.getEntityUuid()); |
369 | 381 |
if(event.hasSource() && event.getSource().isReadOnly()){ |
Also available in: Unified diff
fix #8376 disabling add new button after first click