incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1386818 - in /incubator/isis/trunk/framework/viewer/wicket: wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/ wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ wicket-ui/...
Date Mon, 17 Sep 2012 20:31:20 GMT
Author: danhaywood
Date: Mon Sep 17 20:31:19 2012
New Revision: 1386818

URL: http://svn.apache.org/viewvc?rev=1386818&view=rev
Log:
ISIS-232: further work upgrading to Wicket 6.0.0

* figured out the reason ComponentFeedbackPanel wasn't working
* temporary workaround : use RenderStrategy.REDIRECT_TO_BUFFER (nb: breaks optimistic locking
flow)

Modified:
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityCollectionsReadOnlyFormPanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityCollectionsReadOnlyFormPanel.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/entity/blocks/propcoll/EntityCollectionsReadOnlyFormPanel.java?rev=1386818&r1=1386817&r2=1386818&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityCollectionsReadOnlyFormPanel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityCollectionsReadOnlyFormPanel.java
Mon Sep 17 20:31:19 2012
@@ -226,15 +226,17 @@ public class EntityCollectionsReadOnlyFo
 
         @Override
         protected void onValidate() {
-            Session.get().getFeedbackMessages().clear(new IFeedbackMessageFilter() {
-
-                private static final long serialVersionUID = 1L;
-
-                @Override
-                public boolean accept(final FeedbackMessage message) {
-                    return message.getReporter() == owningPanel;
-                }
-            });
+            // 6.0.0 - no longer required because feedback messages are automatically cleaned
up
+            // see https://cwiki.apache.org/WICKET/migration-to-wicket-60.html#MigrationtoWicket6.0-FeedbackStorageRefactoring
+//            Session.get().getFeedbackMessages().clear(new IFeedbackMessageFilter() {
+//
+//                private static final long serialVersionUID = 1L;
+//
+//                @Override
+//                public boolean accept(final FeedbackMessage message) {
+//                    return message.getReporter() == owningPanel;
+//                }
+//            });
             super.onValidate();
         }
     }

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.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/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.java?rev=1386818&r1=1386817&r2=1386818&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/EntityPropertiesAndOrCollectionsPanel.java
Mon Sep 17 20:31:19 2012
@@ -24,6 +24,7 @@ import java.util.List;
 import org.apache.wicket.Component;
 import org.apache.wicket.Session;
 import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.feedback.FeedbackCollector;
 import org.apache.wicket.feedback.FeedbackMessage;
 import org.apache.wicket.feedback.IFeedbackMessageFilter;
 import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -434,15 +435,17 @@ public class EntityPropertiesAndOrCollec
         
         @Override
         protected void onValidate() {
-            Session.get().getFeedbackMessages().clear(new IFeedbackMessageFilter() {
-
-                private static final long serialVersionUID = 1L;
-
-                @Override
-                public boolean accept(final FeedbackMessage message) {
-                    return message.getReporter() == owningPanel;
-                }
-            });
+            // 6.0.0 - no longer required because feedback messages are automatically cleaned
up
+            // see https://cwiki.apache.org/WICKET/migration-to-wicket-60.html#MigrationtoWicket6.0-FeedbackStorageRefactoring
+//            Session.get().getFeedbackMessages().clear(new IFeedbackMessageFilter() {
+//
+//                private static final long serialVersionUID = 1L;
+//
+//                @Override
+//                public boolean accept(final FeedbackMessage message) {
+//                    return message.getReporter() == owningPanel;
+//                }
+//            });
             super.onValidate();
         }
 

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldAbstract.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/scalars/ScalarPanelTextFieldAbstract.java?rev=1386818&r1=1386817&r2=1386818&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldAbstract.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldAbstract.java
Mon Sep 17 20:31:19 2012
@@ -23,6 +23,7 @@ import java.io.Serializable;
 
 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.Component;
+import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.AbstractTextComponent;
 import org.apache.wicket.markup.html.form.FormComponentLabel;
@@ -79,13 +80,18 @@ public abstract class ScalarPanelTextFie
 
         final String describedAs = getModel().getDescribedAs();
         if(describedAs != null) {
-            labelIfRegular.add(new AttributeModifier("title", true, Model.of(describedAs)));
+            labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs)));
         }
         
-        labelIfRegular.addOrReplace(new ComponentFeedbackPanel(ID_FEEDBACK, textField));
+        addFeedbackTo(labelIfRegular);
         return labelIfRegular;
     }
 
+    protected void addFeedbackTo(MarkupContainer markupContainer) {
+        // 6.0.0
+        markupContainer.addOrReplace(new ComponentFeedbackPanel(ID_FEEDBACK, textField));
+    }
+
     /**
      * Optional hook method
      */
@@ -127,7 +133,7 @@ public abstract class ScalarPanelTextFie
     protected void setTextFieldSizeIfSpecified(AbstractTextComponent<T> textField)
{
         final Integer size = determineSize();
         if (size != null) {
-            textField.add(new AttributeModifier("size", true, Model.of("" + size)));
+            textField.add(new AttributeModifier("size", Model.of("" + size)));
         }
     }
 
@@ -179,7 +185,7 @@ public abstract class ScalarPanelTextFie
     }
 
     private void setTitleAttribute(final String titleAttribute) {
-        textField.add(new AttributeModifier("title", true, Model.of(titleAttribute)));
+        textField.add(new AttributeModifier("title", Model.of(titleAttribute)));
     }
 
 }

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.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/scalars/jodatime/JodaLocalDatePanel.java?rev=1386818&r1=1386817&r2=1386818&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.java
Mon Sep 17 20:31:19 2012
@@ -21,10 +21,16 @@ package org.apache.isis.viewer.wicket.ui
 
 import java.util.Date;
 
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.markup.html.form.FormComponentLabel;
+import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
+import org.apache.wicket.model.Model;
 import org.joda.time.LocalDate;
 
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldDatePickerAbstract;
+import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
 
 /**
  * Panel for rendering scalars of type {@link LocalDate}.
@@ -48,4 +54,5 @@ public class JodaLocalDatePanel extends 
         return new LocalDate(date.getTime());
     }
 
+
 }

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java?rev=1386818&r1=1386817&r2=1386818&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
Mon Sep 17 20:31:19 2012
@@ -125,8 +125,6 @@ public class IsisWicketApplication exten
 
     private static final long serialVersionUID = 1L;
 
-    //private static final String WICKET_CONFIGURATION_TYPE_DEVELOPMENT = Application.DEVELOPMENT;
-
     /**
      * Convenience locator, downcasts inherited functionality.
      */
@@ -163,7 +161,6 @@ public class IsisWicketApplication exten
      * {@link Inject}ed when {@link #init() initialized}.
      */
     @Inject
-    @SuppressWarnings("unused")
     private IsisSystem system;
 
     // /////////////////////////////////////////////////
@@ -183,11 +180,19 @@ public class IsisWicketApplication exten
         super.init();
         
         // 6.0.0 rather than overriding getRequestCycleSettings
-        getRequestCycleSettings().setRenderStrategy(RenderStrategy.REDIRECT_TO_RENDER);
+        //
+        // TODO: to reinstate for our optimistic locking strategy; 
+        // need to use REDIRECT_TO_BUFFER temporarily in order to get FeedbackMessage's to
render
+        // see enquiry raised on wicket-user@a.o
+        
+        //final RenderStrategy renderStrategy = RenderStrategy.REDIRECT_TO_RENDER;
+        final RenderStrategy renderStrategy = RenderStrategy.REDIRECT_TO_BUFFER;
+        
+        getRequestCycleSettings().setRenderStrategy(renderStrategy);
+        
         // 6.0.0 instead of subclassing newRequestCycle 
         getRequestCycleListeners().add(new WebRequestCycleForIsis());
 
-        
         getResourceSettings().setParentFolderPlaceholder("$up$");
 
         final DeploymentType deploymentType = determineDeploymentType();
@@ -208,7 +213,6 @@ public class IsisWicketApplication exten
 
     private DeploymentType determineDeploymentType() {
         if (usesDevelopmentConfig()) {
-        //if (getConfigurationType().equalsIgnoreCase(WICKET_CONFIGURATION_TYPE_DEVELOPMENT))
{
             return new WicketServerPrototype();
         } else {
             return new WicketServer();



Mime
View raw message