- Added support for 'LIST' constraint type, now if a property that has this constraint is shown on a form a drop down list of the allowable values is rendered

- Added new generic 'select' control which given a list of values renders a drop down menu

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13702 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2009-03-20 13:42:28 +00:00
parent 7a010a2836
commit b64489e53a

View File

@@ -309,10 +309,30 @@ public class NodeHandler extends AbstractHandler
Map<String, Object> constraintParams = constraint.getParameters();
if (constraintParams != null)
{
// TODO: Just return the param value object, don't convert to String
fieldConstraintParams = new HashMap<String, String>(constraintParams.size());
for (String name : constraintParams.keySet())
{
fieldConstraintParams.put(name, constraintParams.get(name).toString());
Object paramValue = constraintParams.get(name);
if (paramValue instanceof List)
{
List paramList = (List)paramValue;
StringBuilder builder = new StringBuilder();
for (int x = 0; x < paramList.size(); x++)
{
if (x > 0)
{
builder.append(",");
}
builder.append(paramList.get(x));
}
paramValue = builder.toString();
}
fieldConstraintParams.put(name, paramValue.toString());
}
}
FieldConstraint fieldConstraint = fieldDef.new FieldConstraint(