cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Multivalued User Picker

ash
6-Contributor
6-Contributor

Multivalued User Picker

Hi,

 

I have a custom attribute. Using Data Utilty I made the attribute multivalued.

The attribute is supposed to be a User Picker. 

I can not see User Picker(code written/datautility id registered/cache cleared)

 

Is it because we cannot have two Data Utility functions for the same attribute(Multivalued and Picker)?

3 REPLIES 3
BineshKumar1
12-Amethyst
(To:ash)

What if you add a multiSelect as true?

 

	public void buildUserPickerConfig(final String component_id, final ModelContext mc) throws WTException
	{
		HashMap<String, Object> defaultProps = new HashMap<String, Object>();
		defaultProps.put("objectType", "wt.org.WTUser");
		defaultProps.put("pickedAttributes", "name");
		defaultProps.put("multiSelect", "true");
		defaultProps.put("showUserType", "ActiveOnly");
		defaultProps.put("readOnlyPickerTextBox", "false");
		defaultProps.put("showSuggestion", "true");
		defaultProps.put("suggestServiceKey", "DocUserPickerId");
		defaultProps.put("label", "Search for User");
		defaultProps.put("pickerTitle", "Search for User");

		HashMap<String, Object> customProps = new HashMap<String, Object>();
		if ("RDSupportEngineer".equalsIgnoreCase(component_id)) {
			customProps.put("pickerId",component_id);
			customProps.put("pickerCallback", "CustomPickerInputComponentCallback");
		}
		defaultProps.putAll(customProps);
		mc.getDescriptor().setProperties(defaultProps);
	}

 

ash
6-Contributor
6-Contributor
(To:BineshKumar1)

Adding multiselect true lets me have more than one users at a time. But the requirement is to have a multi value i.e. to have individual users.. that shall be mapped to their respective attributes. 

albertrj
4-Participant
(To:BineshKumar1)

With pickedAttributes I am unable to specify multiple attributes to be fetched and displayed as mentioned in help center.
Following is the line of code I added for it :
PickerRenderConfigs.setDefaultPickerProperty(map, "pickedAttributes",
"name, number,longDescription.formattedText");
Is there anything wrong in the syntax. Or is there something else to do as well ?
Top Tags