labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r744988 - in /labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview: BeanFormProducer.java ShowBean.java
Date Tue, 17 Feb 2009 12:12:07 GMT
Author: simoneg
Date: Tue Feb 17 12:12:06 2009
New Revision: 744988

URL: http://svn.apache.org/viewvc?rev=744988&view=rev
Log:
LABS-295 : errors in xhtml generated by smartform and showbean

Modified:
    labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
    labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java

Modified: labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java?rev=744988&r1=744987&r2=744988&view=diff
==============================================================================
--- labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
(original)
+++ labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
Tue Feb 17 12:12:06 2009
@@ -68,7 +68,7 @@
 	public void produce(OutputStream stream) {
 		OutputStreamWriter out = new OutputStreamWriter(stream, "UTF-8");
 		try {
-			out.write("<form action=\"filled\" method=\"POST\" accept-charset=\"utf-8\">");
+			out.write("<form action=\"filled\" method=\"POST\" accept-charset=\"utf-8\"><div>");
 			out.write("<input type=\"submit\" class=\"DefaultHiddenSubmit\" value=\"-\"/>");
 			out.flush();
 			super.produce(stream);
@@ -81,7 +81,7 @@
 					i++;
 				}
 			}
-			out.write("</form>");
+			out.write("</div></form>");
 			out.flush();
 		} catch (IOException e) {
 			throw new MagmaException(e, "Error writing to output");
@@ -111,7 +111,7 @@
 		}
 		
 		
-		createAdditionalInfo(node, sb.toString(), out);	
+		createAdditionalInfo(node, sb.toString(), out, "label");	
 		out.append("<label for=\"" + node.getCorrespondingFieldId() + "\">");
 		super.createLabelNodeOutput(node, out);
 		if (allvals != null && !allvals.acceptsNulls()) {
@@ -219,6 +219,15 @@
 				out.write("TODO .. too many to use drop down");
 			}
 			*/
+		} else {
+			StringBuilder sb = new StringBuilder();
+			sb.append("MagmaField Select");
+			commonFieldClasses(node, sb);
+			createAdditionalInfo(node, sb.toString(), out);
+			
+			out.append("<input type=\"hidden\" ");
+			createNameAndId(node, out);
+			out.append("/>");			
 		}
 	}
 	
@@ -346,7 +355,7 @@
 			out.append('\"');
 		}
 		if (maxSize > 0) {
-			out.append(" maxLength=\"");
+			out.append(" maxlength=\"");
 			out.append(Integer.toString(maxSize));			
 			out.append('\"');
 		}
@@ -403,7 +412,7 @@
 			out.append('\"');
 		}
 		if (maxSize > 0) {
-			out.append(" maxLength=\"");
+			out.append(" maxlength=\"");
 			out.append(Integer.toString(maxSize));			
 			out.append('\"');
 		}

Modified: labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java
URL: http://svn.apache.org/viewvc/labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java?rev=744988&r1=744987&r2=744988&view=diff
==============================================================================
--- labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java
(original)
+++ labs/magma/branches/0.0.1/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java
Tue Feb 17 12:12:06 2009
@@ -218,7 +218,7 @@
 					}
 				}
 				if (sliceNodes.size() > 1) {
-					out.append("</tr></td>");				
+					out.append("</td></tr>");				
 					out.append("</table>");
 				}
 				if (slice + 1 < zone.getSlices()) {
@@ -227,7 +227,7 @@
 			}
 		}
 		if (zone.getSlices() > 1) {
-			out.append("</tr></td>");
+			out.append("</td></tr>");
 			out.append("</table>");
 		}
 	}
@@ -278,15 +278,20 @@
 		//out.append("Node " + node.getId());
 	}
 
-	protected void createAdditionalInfo(Node node, String baseclass, Writer out) throws IOException
{
+	protected void createAdditionalInfo(Node node, String baseclass, Writer out, String idsuffix)
throws IOException {
 		out.append("|MAGMA-");
 		out.append("class=\"");
 		out.append(baseclass);
 		out.append("\" id=\"");
 		out.append(node.getId());
-		out.append("-cell");
+		out.append("-");
+		out.append(idsuffix);
 		out.append("\"");
-		out.append("|");
+		out.append("|");		
+	}
+	
+	protected void createAdditionalInfo(Node node, String baseclass, Writer out) throws IOException
{
+		createAdditionalInfo(node, baseclass, out, "cell");
 	}
 	public ViewCustomizer getCustomizer() {
 		return filter;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message