mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for forum-reported NPE with ajax category selector
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8297 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -140,25 +140,28 @@ public abstract class BaseAjaxItemPicker extends UIInput
|
|||||||
Map requestMap = context.getExternalContext().getRequestParameterMap();
|
Map requestMap = context.getExternalContext().getRequestParameterMap();
|
||||||
String fieldId = getHiddenFieldName();
|
String fieldId = getHiddenFieldName();
|
||||||
String value = (String)requestMap.get(fieldId);
|
String value = (String)requestMap.get(fieldId);
|
||||||
if (value.equals("empty"))
|
if (value != null)
|
||||||
{
|
{
|
||||||
this.setSubmittedValue(new String("empty"));
|
if (value.equals("empty"))
|
||||||
}
|
|
||||||
else if (value != null && value.length() != 0)
|
|
||||||
{
|
|
||||||
if (getSingleSelect() == true)
|
|
||||||
{
|
{
|
||||||
NodeRef ref = new NodeRef(value);
|
this.setSubmittedValue(new String("empty"));
|
||||||
this.setSubmittedValue(ref);
|
|
||||||
}
|
}
|
||||||
else
|
else if (value.length() != 0)
|
||||||
{
|
{
|
||||||
List<NodeRef> refs = new ArrayList<NodeRef>(5);
|
if (getSingleSelect() == true)
|
||||||
for (StringTokenizer t = new StringTokenizer(value, ","); t.hasMoreTokens(); /**/)
|
|
||||||
{
|
{
|
||||||
refs.add(new NodeRef(t.nextToken()));
|
NodeRef ref = new NodeRef(value);
|
||||||
|
this.setSubmittedValue(ref);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<NodeRef> refs = new ArrayList<NodeRef>(5);
|
||||||
|
for (StringTokenizer t = new StringTokenizer(value, ","); t.hasMoreTokens(); /**/)
|
||||||
|
{
|
||||||
|
refs.add(new NodeRef(t.nextToken()));
|
||||||
|
}
|
||||||
|
this.setSubmittedValue(refs);
|
||||||
}
|
}
|
||||||
this.setSubmittedValue(refs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user