<emm:instantiate type="org.apache.commons.collections4.map.CaseInsensitiveMap" var="titles">
    <c:set target="${titles}" property="gender" value="recipient.Salutation"/>
    <c:set target="${titles}" property="firstname" value="Firstname"/>
    <c:set target="${titles}" property="lastname" value="Lastname"/>
    <c:set target="${titles}" property="creation_date" value="default.creationDate"/>
    <c:set target="${titles}" property="timestamp" value="default.changeDate"/>
</emm:instantiate>

<c:forEach var="field" items="${fieldsMap}">
    <c:set var="column" value="${field.key}"/>
    <c:if test="${listForm.isSelectedColumn(column)}">

        <%--@elvariable id="recipient" type="com.agnitas.emm.core.recipient.dto.RecipientDto"--%>
        <c:set var="value" value="${recipient.getValue(column)}"/>
        <c:set var="formattedValue" value="${recipient.getColumnFormattedValue(admin, column)}"/>

        <c:choose>
            <c:when test="${fn:toLowerCase(column) eq 'gender'}">
                <display:column class="recipient_title" headerClass="js-table-sort"
                                titleKey="recipient.Salutation" sortable="true"
                                sortProperty="gender">
                    <mvc:message code="recipient.gender.${value}.short"/>
                </display:column>
            </c:when>

            <c:otherwise>
                <c:set var="titleKey" value="${titles.get(column)}"/>
                <c:set var="title" value="${field.value}"/>
                <c:if test="${not empty titleKey}">
                    <mvc:message var="title" code="${titleKey}"/>
                </c:if>
                <display:column class="recipient_title"
                                headerClass="js-table-sort"
                                title="${title}"
                                sortable="true" sortProperty="${column}">
                    ${fn:escapeXml(formattedValue)}
                </display:column>
            </c:otherwise>
        </c:choose>

    </c:if>
</c:forEach>
