}
if (field == null) {
return;
}
FormAttributeField annotation = field.getAnnotation(FormAttributeField.class);
BeanWrapper wrapper = PropertyAccessorFactory.
forBeanPropertyAccess(ReportletConfModalPage.this.reportletConf);
Panel panel;
if (String.class.equals(field.getType()) && annotation != null && annotation.userSearch()) {
panel = new UserSearchPanel.Builder("value").
fiql((String) wrapper.getPropertyValue(fieldName)).required(false).build();
// This is needed in order to manually update this.reportletConf with search panel selections
panel.setDefaultModel(new Model<String>(fieldName));
} else if (String.class.equals(field.getType()) && annotation != null && annotation.roleSearch()) {
panel = new RoleSearchPanel.Builder("value").
fiql((String) wrapper.getPropertyValue(fieldName)).required(false).build();
// This is needed in order to manually update this.reportletConf with search panel selections
panel.setDefaultModel(new Model<String>(fieldName));
} else if (List.class.equals(field.getType())) {
Class<?> listItemType = String.class;
if (field.getGenericType() instanceof ParameterizedType) {
listItemType =
(Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
}
if (listItemType.equals(String.class) && annotation != null) {
List<String> choices;
switch (annotation.schema()) {
case UserSchema:
choices = schemaRestClient.getSchemaNames(AttributableType.USER);
break;
case UserDerivedSchema: