incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1240299 - in /incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view: action/Methods.java edit/FieldFactory.java form/HtmlFormBuilder.java form/InputField.java
Date Fri, 03 Feb 2012 19:05:40 GMT
Author: rmatthews
Date: Fri Feb  3 19:05:40 2012
New Revision: 1240299

URL: http://svn.apache.org/viewvc?rev=1240299&view=rev
Log:
Isis-162 - fixed methods element and made forms set the fields' classes to the type of data
they are using (so css and javascript can do specific things with them).

Modified:
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/Methods.java
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/InputField.java

Modified: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/Methods.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/Methods.java?rev=1240299&r1=1240298&r2=1240299&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/Methods.java
(original)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/Methods.java
Fri Feb  3 19:05:40 2012
@@ -146,7 +146,7 @@ public class Methods extends AbstractEle
                     // parameters.id = request.getOptionalProperty(ID);
                     ActionForm.createForm(request, params, true);
                 } else {
-                    request.appendHtml("<a class=\"button\" href=\"_generic_action." +
Dispatcher.EXTENSION + "?_result=" + objectId + "&amp;" + VERSION + "=" + version + "&_method="
+ action.getId());
+                    request.appendHtml("<a class=\"button\" href=\"_generic_action." +
Dispatcher.EXTENSION + "?_result=" + objectId + "&amp;_" + VERSION + "=" + version + "&_="
+ METHOD + action.getId());
                     if (cancelTo != null) {
                         request.appendHtml("&_cancel-to=");
                         request.appendAsHtmlEncoded("cancel-to=\"" + cancelTo + "\"");

Modified: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java?rev=1240299&r1=1240298&r2=1240299&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java
(original)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java
Fri Feb  3 19:05:40 2012
@@ -40,6 +40,7 @@ public class FieldFactory {
 
         field.setLabel(param.getName());
         field.setDescription(param.getDescription());
+        field.setDataType(param.getSpecification().getShortIdentifier());
         if (param instanceof ObjectMember) {
             field.setHelpReference(((ObjectMember) param).getHelp());
         } else {

Modified: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java?rev=1240299&r1=1240298&r2=1240299&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java
(original)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/HtmlFormBuilder.java
Fri Feb  3 19:05:40 2012
@@ -29,7 +29,7 @@ public class HtmlFormBuilder {
             final String errors, final String cancelTo) {
 
         String classSegment = " class=\"" + className + (id == null ? "\"" : "\" id=\"" +
id + "\"");
-        request.appendHtml("<form " + classSegment + " action=\"" + action + "\" method=\"post\"
accept-charset=\"ISO-8859-1\">\n");
+        request.appendHtml("<form " + classSegment + " action=\"" + action + "\" method=\"post\"
accept-charset=\"UTF-8\">\n");
         if (formTitle != null && formTitle.trim().length() > 0) {
             classSegment = " class=\"title\"";
             request.appendHtml("<div" + classSegment + ">");
@@ -149,7 +149,8 @@ public class HtmlFormBuilder {
         final String maxLengthSegment = field.getMaxLength() == 0 ? "" : " maxlength=\""
+ field.getMaxLength() + "\"";
         final String requiredSegment = !field.isRequired() ? "" : " <span class=\"required\">*</span>";
         final String disabled = field.isEditable() ? "" : " disabled=\"disabled\"";
-        return "<input type=\"" + type + "\" name=\"" + field.getName() + "\"" + valueSegment
+ lengthSegment + maxLengthSegment + disabled + additionalAttributes + " />" + requiredSegment;
+        return "<input class=\"" + field.getDataType() + "\" + type=\"" + type + "\" name=\""
+ field.getName() + "\"" + 
+                valueSegment + lengthSegment + maxLengthSegment + disabled + additionalAttributes
+ " />" + requiredSegment;
     }
 
     private static String createCheckbox(final InputField field) {

Modified: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/InputField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/InputField.java?rev=1240299&r1=1240298&r2=1240299&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/InputField.java
(original)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/form/InputField.java
Fri Feb  3 19:05:40 2012
@@ -35,6 +35,7 @@ public class InputField {
     private String helpReference;
     private String errorText;
     private final String name;
+    private String dataType;
 
     private int maxLength = 0;
     private int width;
@@ -63,6 +64,10 @@ public class InputField {
         return description;
     }
 
+    public String getDataType() {
+        return dataType;
+    }
+    
     public String getHelpReference() {
         return helpReference;
     }
@@ -185,6 +190,10 @@ public class InputField {
         this.type = type;
     }
 
+    public void setDataType(String dataType) {
+        this.dataType = dataType;
+    }
+    
     @Override
     public String toString() {
         final ToString str = new ToString(this);
@@ -205,6 +214,7 @@ public class InputField {
             break;
         }
         str.append("type", typeName);
+        str.append("datatype", dataType);
         str.append("editable", isEditable);
         str.append("hidden", isHidden);
         str.append("required", isRequired);



Mime
View raw message