Revision: 1340
http://stripes.svn.sourceforge.net/stripes/?rev=1340&view=rev
Author: bengunter
Date: 2010-11-12 18:44:16 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
Fixed STS-778: The "field-metadata" tag should include "ignore" validation
attribute. Also changed so that boolean settings, which cannot be null, always
get written out. In the past they were only written out if they were true.
Modified Paths:
--------------
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java
===================================================================
---
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java
2010-11-12 16:45:44 UTC (rev 1339)
+++
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java
2010-11-12 18:44:16 UTC (rev 1340)
@@ -159,14 +159,13 @@
Class<?> typeConverterClass = null;
if (data != null) {
- if (data.encrypted())
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("encrypted:")
- .append(data.encrypted());
- if (data.required())
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("required:").append(
- data.required());
+ fieldInfo.append("required:").append(data.required())
+ .append(",ignore:").append(data.ignore())
+ .append(",encrypted:").append(data.encrypted())
+ .append(",trim:").append(data.trim());
+
if (data.on() != null) {
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("on:[");
+ fieldInfo.append(",on:[");
Iterator<String> it = data.on().iterator();
while (it.hasNext()) {
fieldInfo.append(JavaScriptBuilder.quote(it.next()));
@@ -175,39 +174,28 @@
}
fieldInfo.append("]");
}
- if (data.trim())
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("trim:").append(
- data.trim());
if (data.mask() != null)
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("mask:")
- .append("new RegExp(")
+ fieldInfo.append(",mask:").append("new RegExp(")
.append(JavaScriptBuilder.quote("^" +
data.mask().toString() + "$"))
.append(")");
if (data.minlength() != null)
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("minlength:")
- .append(data.minlength());
+ fieldInfo.append(",minlength:").append(data.minlength());
if (data.maxlength() != null)
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("maxlength:")
- .append(data.maxlength());
+ fieldInfo.append(",maxlength:").append(data.maxlength());
if (data.minvalue() != null)
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("minvalue:").append(
- data.minvalue());
+ fieldInfo.append(",minvalue:").append(data.minvalue());
if (data.maxvalue() != null)
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("maxvalue:").append(
- data.maxvalue());
-
+ fieldInfo.append(",maxvalue:").append(data.maxvalue());
+
String label = data.label();
- if (data.label() == null)
- {
- label = LocalizationUtility.getLocalizedFieldName(field,
- form == null ? null : form.getAction(),
- form == null ? null : form.getActionBeanClass(),
+ if (data.label() == null) {
+ label = LocalizationUtility.getLocalizedFieldName(field,
form == null ? null
+ : form.getAction(), form == null ? null :
form.getActionBeanClass(),
locale);
}
if (label != null)
- fieldInfo.append(fieldInfo.length() > 0 ? "," :
"").append("label:").append(
- JavaScriptBuilder.quote(label));
-
+
fieldInfo.append(",label:").append(JavaScriptBuilder.quote(label));
+
typeConverterClass = data.converter();
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development