Revision 0844524a
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/StartRegistrationPresenter.java | ||
---|---|---|
9 | 9 |
package eu.etaxonomy.cdm.vaadin.view.registration; |
10 | 10 |
|
11 | 11 |
import java.util.EnumSet; |
12 |
import java.util.UUID; |
|
12 | 13 |
|
13 | 14 |
import org.vaadin.spring.events.EventScope; |
14 | 15 |
import org.vaadin.spring.events.annotation.EventBusListenerMethod; |
... | ... | |
153 | 154 |
} |
154 | 155 |
} |
155 | 156 |
|
157 |
@SuppressWarnings("null") |
|
156 | 158 |
@EventBusListenerMethod(filter = EditorActionTypeFilter.Add.class) |
157 | 159 |
public void onRegistrationEditorActionAdd(RegistrationEditorAction event) { |
158 | 160 |
|
... | ... | |
160 | 162 |
return; |
161 | 163 |
} |
162 | 164 |
|
163 |
Integer referenceId = null;
|
|
165 |
UUID referenceUuid = null;
|
|
164 | 166 |
LazyComboBox<Reference> referenceCombobox = getView().getReferenceCombobox(); |
165 | 167 |
referenceCombobox.commit(); |
166 | 168 |
if(newReference != null){ |
167 |
referenceId = newReference.getId();
|
|
169 |
referenceUuid = newReference.getUuid();
|
|
168 | 170 |
// } else if(referenceCombobox.getValue() != null) { |
169 |
} else if ( event.getEntityId() != null) { // HACKED, see view implementation
|
|
170 |
referenceId = event.getEntityId();
|
|
171 |
} else if ( event.getEntityUuid() != null) { // HACKED, see view implementation
|
|
172 |
referenceUuid = event.getEntityUuid();
|
|
171 | 173 |
} |
172 |
if(referenceId == null){
|
|
174 |
if(referenceUuid == null){
|
|
173 | 175 |
getView().getContinueButton().setComponentError(new UserError("Can't continue. No Reference is chosen.")); |
174 | 176 |
getView().getContinueButton().setEnabled(false); |
175 | 177 |
} |
176 | 178 |
registrationInProgress = true; |
177 |
viewEventBus.publish(EventScope.UI, this, new NavigationEvent(RegistrationWorksetViewBean.NAME, Integer.toString(referenceId)));
|
|
179 |
viewEventBus.publish(EventScope.UI, this, new NavigationEvent(RegistrationWorksetViewBean.NAME, referenceUuid.toString()));
|
|
178 | 180 |
|
179 | 181 |
} |
180 | 182 |
|
Also available in: Unified diff
switching vom id based to uuid based ui navigation and entity references