incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1379526 - /incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
Date Fri, 31 Aug 2012 17:44:09 GMT
Author: danhaywood
Date: Fri Aug 31 17:44:09 2012
New Revision: 1379526

URL: http://svn.apache.org/viewvc?rev=1379526&view=rev
Log:
ISIS-232: creating of loadable/detachable models w.r.t transactions

The loadable/detachable model (eg EntityModel) should only be created
after the transaction has been executed (all changes flushed).

This fix addresses this for the invocation of actions.

Modified:
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java?rev=1379526&r1=1379525&r2=1379526&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
Fri Aug 31 17:44:09 2012
@@ -28,6 +28,7 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
 import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.viewer.wicket.model.common.SelectionHandler;
 import org.apache.isis.viewer.wicket.model.isis.PersistenceSessionProvider;
 import org.apache.isis.viewer.wicket.model.models.ActionExecutor;
@@ -131,6 +132,7 @@ public class ActionPanel extends PanelAb
 
                 final ObjectAdapter actualAdapter = determineActualAdapter(resultAdapter,
actionPanel);
 
+                //actionPanel.set
                 addResultsAccordingToSingleResultsMode(actionPanel, actualAdapter, null);
             }
 
@@ -158,12 +160,17 @@ public class ActionPanel extends PanelAb
 
                 if (singleResultsMode == ActionModel.SingleResultsMode.REDIRECT) {
 
+                    // force any changes in state etc to happen now prior to the redirect;
+                    // this should cause our page mementos (eg EntityModel) to hold the correct
state.  I hope.
+                    IsisContext.getTransactionManager().getTransaction().flush();
+                    
                     // build page, also propogate any concurrency exception that might have
occurred already
                     final EntityPage entityPage = new EntityPage(actualAdapter, exIfAny);
                     
                     // "redirect-after-post"
                     panel.setRedirect(true);
                     panel.setResponsePage(entityPage);
+                    
                 } else if (singleResultsMode == ActionModel.SingleResultsMode.SELECT) {
                     panel.hideAll();
                     actionModel.getSelectionHandler().onSelected(panel, actualAdapter);



Mime
View raw message