Project

General

Profile

« Previous | Next » 

Revision 96783004

Added by Andreas Kohlbecker almost 7 years ago

ref #6562 presenters can handle events from own view & solving listSelect update problem

View differences:

src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmEditorPresenter.java
47 47
    @Override
48 48
    @EventListener
49 49
    public void onEditorPreSaveEvent(EditorPreSaveEvent preSaveEvent){
50

  
50
        if(!isFromOwnView(preSaveEvent)){
51
            return;
52
        }
51 53
        if(tx != null){
52 54
            // @formatter:off
53 55
            // holding the TransactionStatus as state is not good design. we should change the save operation
......
59 61
            // @formatter:on
60 62
            throw new RuntimeException("Can't process a second save operation while another one is in progress.");
61 63
        }
62
        super.onEditorPreSaveEvent(preSaveEvent);
63 64

  
64 65
        logger.trace(this._toString() + ".onEditorPreSaveEvent - starting transaction");
65 66
        tx = getRepo().startTransaction(true);
......
74 75
    @Override
75 76
    @EventListener
76 77
    public void onEditorSaveEvent(EditorSaveEvent saveEvent){
77

  
78
        if(!isFromOwnView(saveEvent)){
79
            return;
80
        }
78 81
        // the bean is now updated with the changes made by the user
79 82
        // merge the bean into the session, ...
80 83
        logger.trace(this._toString() + ".onEditorSaveEvent - merging bean into session");

Also available in: Unified diff