isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1067341 - in /incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher: action/ edit/ processor/ view/display/ view/form/
Date Fri, 04 Feb 2011 23:21:48 GMT
Author: rmatthews
Date: Fri Feb  4 23:21:47 2011
New Revision: 1067341

URL: http://svn.apache.org/viewvc?rev=1067341&view=rev
Log:
Improved feedback on edit and action forms.

Removed:
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/Errors.java
Modified:
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java?rev=1067341&r1=1067340&r2=1067341&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java
Fri Feb  4 23:21:47 2011
@@ -140,7 +140,7 @@ public class ActionAction implements Act
                 context.setRequestPath(view, Dispatcher.ACTION);
                 
                 MessageBroker messageBroker = IsisContext.getMessageBroker();
-                messageBroker.addMessage(error);
+                messageBroker.addWarning(error);
             }
 
         } catch (ConcurrencyException e) {

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java?rev=1067341&r1=1067340&r2=1067341&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java
Fri Feb  4 23:21:47 2011
@@ -124,6 +124,9 @@ public class EditAction implements Actio
                 if (override != null) {
                     context.addVariable(resultName, override, Scope.REQUEST);
                 }   
+                
+                MessageBroker messageBroker = IsisContext.getMessageBroker();
+                messageBroker.addWarning(entryState.getError());
             }
 
         } catch (RuntimeException e) {
@@ -169,6 +172,7 @@ public class EditAction implements Actio
             Consent consent = null;
             if (field.isMandatory() && newEntry.equals("")) {
                 consent = new Veto(field.getName() + " required");
+                formState.setError("Not all fields have been set");
 
             } else if (field.getSpecification().containsFacet(ParseableFacet.class)) {
                 try {
@@ -179,6 +183,7 @@ public class EditAction implements Actio
                     fieldState.setValue(originalValue);
                 } catch (TextEntryParseException e) {
                     consent = new Veto(e.getMessage());
+                    formState.setError("Not all fields have been entered correctly");
                 }
 
             } else {
@@ -192,6 +197,7 @@ public class EditAction implements Actio
             }
             if (consent.isVetoed()) {
                 fieldState.setError(consent.getReason());
+                formState.setError("Not all fields have been entered correctly");
             }
         }
 

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java?rev=1067341&r1=1067340&r2=1067341&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java
Fri Feb  4 23:21:47 2011
@@ -43,7 +43,6 @@ import org.apache.isis.viewer.scimpi.dis
 import org.apache.isis.viewer.scimpi.dispatcher.view.debug.ThrowException;
 import org.apache.isis.viewer.scimpi.dispatcher.view.display.AddMessage;
 import org.apache.isis.viewer.scimpi.dispatcher.view.display.AddWarning;
-import org.apache.isis.viewer.scimpi.dispatcher.view.display.Errors;
 import org.apache.isis.viewer.scimpi.dispatcher.view.display.Feedback;
 import org.apache.isis.viewer.scimpi.dispatcher.view.display.FieldLabel;
 import org.apache.isis.viewer.scimpi.dispatcher.view.display.FieldValue;

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java?rev=1067341&r1=1067340&r2=1067341&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java
Fri Feb  4 23:21:47 2011
@@ -23,7 +23,6 @@ package org.apache.isis.viewer.scimpi.di
 import org.apache.isis.core.commons.exceptions.UnknownTypeException;
 import org.apache.isis.viewer.scimpi.dispatcher.processor.Request;
 import org.apache.isis.viewer.scimpi.dispatcher.view.HelpLink;
-import org.apache.isis.viewer.scimpi.dispatcher.view.display.Errors;
 
 
 public class HtmlFormBuilder {
@@ -51,6 +50,10 @@ public class HtmlFormBuilder {
         // TODO reinstate fieldsets when we can specify them
         //request.appendHtml("<fieldset>\n");
 
+        String cls = "errors";
+        if (errors != null) {
+            request.appendHtml("<div class=\"" + cls + "\">" + errors + "</div>");
+        }
         for (int i = 0; i < hiddenFields.length; i++) {
             HiddenInputField hiddenField = hiddenFields[i];
             if (hiddenField == null) {
@@ -74,15 +77,6 @@ public class HtmlFormBuilder {
                         + errorSegment + helpSegment + "</div>\n");
             }
         }
-
-        // Errors.append(request, null);
-        
-      //  Object errors = request.getContext().getVariable(RequestContext.ERROR);
-        String cls = "errors";
-        if (errors != null) {
-            request.appendHtml("<div class=\"" + cls + "\">" + errors + "</div>");
-        }
-        
         
         request.appendHtml("  <input class=\"button\" type=\"submit\" value=\"" + buttonTitle
+ "\" name=\"execute\" />\n");
         HelpLink.append(request, description, helpReference);



Mime
View raw message