mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixed persistence of boolean properties, checkbox control was not sending false when unchecked and sending 'on' as value when selected
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14335 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -77,6 +77,7 @@ public class NodeHandler extends AbstractHandler
|
|||||||
{
|
{
|
||||||
private static final Log logger = LogFactory.getLog(NodeHandler.class);
|
private static final Log logger = LogFactory.getLog(NodeHandler.class);
|
||||||
|
|
||||||
|
protected static final String ON = "on";
|
||||||
protected static final String PROP = "prop";
|
protected static final String PROP = "prop";
|
||||||
protected static final String ASSOC = "assoc";
|
protected static final String ASSOC = "assoc";
|
||||||
protected static final String DATA_KEY_SEPARATOR = "_";
|
protected static final String DATA_KEY_SEPARATOR = "_";
|
||||||
@@ -912,6 +913,14 @@ public class NodeHandler extends AbstractHandler
|
|||||||
// persist the List
|
// persist the List
|
||||||
value = list;
|
value = list;
|
||||||
}
|
}
|
||||||
|
else if (propDef.getDataType().getName().equals(DataTypeDefinition.BOOLEAN))
|
||||||
|
{
|
||||||
|
// check for browser representation of true, that being "on"
|
||||||
|
if (value instanceof String && ON.equals(value))
|
||||||
|
{
|
||||||
|
value = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (propDef.getDataType().getName().equals(DataTypeDefinition.LOCALE))
|
else if (propDef.getDataType().getName().equals(DataTypeDefinition.LOCALE))
|
||||||
{
|
{
|
||||||
value = I18NUtil.parseLocale((String)value);
|
value = I18NUtil.parseLocale((String)value);
|
||||||
@@ -1002,6 +1011,8 @@ public class NodeHandler extends AbstractHandler
|
|||||||
// Each element in this array will be a new target node in association
|
// Each element in this array will be a new target node in association
|
||||||
// with the current node.
|
// with the current node.
|
||||||
for (String nextTargetNode : nodeRefs)
|
for (String nextTargetNode : nodeRefs)
|
||||||
|
{
|
||||||
|
if (nextTargetNode.length() > 0)
|
||||||
{
|
{
|
||||||
if (NodeRef.isNodeRef(nextTargetNode))
|
if (NodeRef.isNodeRef(nextTargetNode))
|
||||||
{
|
{
|
||||||
@@ -1061,6 +1072,7 @@ public class NodeHandler extends AbstractHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persists the given field data as the name property
|
* Persists the given field data as the name property
|
||||||
|
Reference in New Issue
Block a user