Page 1 of 1

/accounts/details/printTransaction.jsp "custom field print"

Posted: Tue Jun 19, 2012 7:25 am
by johngrg
After each transaction I would like to add custom fields for each transaction.The code exists i think below however i do not know how to make use of it.

<c:forEach var="entry" items="${customFields}">
<c:set var="field" value="${entry.field}"/>
<c:set var="value" value="${entry.value}"/>
<c:if test="${not empty value.value}">
<tr>
<td colspan="2">
<span class="printLabel">${field.name}:</span>
<span class="printData"><cyclos:customField field="${field}" value="${value}" textOnly="true"/></span>
</td>
</tr>
</c:if>
</c:forEach>
............................................................

for TransactionHistory.jsp tried the code provided earlier by Admin and in the post and its working.

<%@page import="nl.strohalm.cyclos.entities.customization.fields.MemberCustomField"%>
<%@page import="nl.strohalm.cyclos.utils.EntityWithCustomFieldsWrapper"%>
<%@page import="java.util.List"%>
<%@page import="nl.strohalm.cyclos.utils.CustomFieldHelper"%>
<%@page import="nl.strohalm.cyclos.entities.members.Member"%>
<%@page import="nl.strohalm.cyclos.services.customization.MemberCustomFieldService"%>
<%@page import="nl.strohalm.cyclos.utils.SpringHelper"%>


<%
MemberCustomFieldService customFieldService = SpringHelper.bean(application, MemberCustomFieldService.class);
Member member = (Member) request.getAttribute("owner");
List<MemberCustomField> customFields = CustomFieldHelper.onlyForGroup(customFieldService.list(), member.getMemberGroup());
EntityWithCustomFieldsWrapper wrapper = new EntityWithCustomFieldsWrapper(member, customFields);
pageContext.setAttribute("member", wrapper);
%>

<tr>
<td class="printLabel" width="20%">City:&nbsp;</td>
<td class="printData" colspan="5">${member.city}</td>
</tr>

Is there same work around exists for printTransaction.jsp..

Thanks
John :)