Search in sources :

Example 6 with SelectFormField

use of org.asqatasun.webapp.form.SelectFormField in project Asqatasun by Asqatasun.

the class AbstractAuditSetUpController method getFreshRefAndLevelSetUpFormFieldList.

/**
     * Create a fresh list of SelectFormField dedicated to the referential and
     * level choice.
     * The call of the helper method is due to activation mechanism. 
     * In this case, the activation of the element is done through the referential
     * list associated with the contract
     * 
     * @param authorisedReferentialList
     * @param auditSetUpFormFieldBuilderList
     * @return 
     */
protected List<SelectFormField> getFreshRefAndLevelSetUpFormFieldList(Collection<String> authorisedReferentialList, List<SelectFormFieldBuilderImpl> auditSetUpFormFieldBuilderList) {
    List<SelectFormField> selectFormFieldList = new LinkedList();
    for (SelectFormFieldBuilderImpl seb : auditSetUpFormFieldBuilderList) {
        // Create the SelectElement from the builder
        SelectFormField selectFormField = seb.build();
        // enable-disable elements from the authorised referentials
        AuditSetUpFormFieldHelper.activateAllowedReferentialField(selectFormField, authorisedReferentialList);
        // add the fresh instance to the returned list
        selectFormFieldList.add(selectFormField);
    }
    return selectFormFieldList;
}
Also used : SelectFormFieldBuilderImpl(org.asqatasun.webapp.form.builder.SelectFormFieldBuilderImpl) SelectFormField(org.asqatasun.webapp.form.SelectFormField)

Aggregations

SelectFormField (org.asqatasun.webapp.form.SelectFormField)6 TextualFormField (org.asqatasun.webapp.form.TextualFormField)2 List (java.util.List)1 Map (java.util.Map)1 AuditSetUpCommand (org.asqatasun.webapp.command.AuditSetUpCommand)1 ContractSortCommand (org.asqatasun.webapp.command.ContractSortCommand)1 Contract (org.asqatasun.webapp.entity.contract.Contract)1 ScopeEnum (org.asqatasun.webapp.entity.contract.ScopeEnum)1 OptionElement (org.asqatasun.webapp.entity.option.OptionElement)1 ForbiddenPageException (org.asqatasun.webapp.exception.ForbiddenPageException)1 FormField (org.asqatasun.webapp.form.FormField)1 NumericalFormField (org.asqatasun.webapp.form.NumericalFormField)1 SelectElement (org.asqatasun.webapp.form.SelectElement)1 SelectFormFieldImpl (org.asqatasun.webapp.form.SelectFormFieldImpl)1 SelectFormFieldBuilderImpl (org.asqatasun.webapp.form.builder.SelectFormFieldBuilderImpl)1