09-30-2011 04:55 AM
public static List<String> getList(DictionaryService dicoService,
QName constraintQName) {
List<String> res= new ArrayList<String>();
ConstraintDefinition constDef = dicoService.getConstraint(constraintQName);
Constraint constraint = constDef.getConstraint();
if (constraint.getType().equals("LIST")) {
ListOfValuesConstraint lovc = (ListOfValuesConstraint)constraint;
res = lovc.getAllowedValues();
}
return res;
}
Mettre dans le "model" i.e la table clé/valeur d'un org.springframework.extensions.webscripts.DeclarativeWebScript;
model.put("checkCivilite", AlfrescoUtils.getList(dicoService, MyContentModel.CHECK_CIVILITE));
Utilisation dans un FTL avec une macro
<@combo listVal=checkCivilite comboName="civilite" />
La macro
<#macro combo listVal comboName>
<select name='${comboName}'>
<#list listVal as key>
<option value='${key}' >${key}</option>
</#list>
</select>
</#macro>
10-04-2011 11:56 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.