This example code defines an action link named selectProductCode for a ReportBlox.
The link is attached to the Product column. When the product name in the report is clicked, the link sets the value for the parameter "code" to the product's code. Additional code is needed to use this information, such as in another portlet. This example only demonstrates how to set the link.
<%@ page contentType="text/html" %>
<%@ taglib uri="bloxtld" prefix="blox"%>
<%@ taglib uri="bloxreporttld" prefix="bloxreport"%>
<%@ taglib uri="bloxportlettld" prefix="bloxportlet" %>
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %>
<portletAPI:init/>
<head>
<blox:header/>
<link rel="stylesheet" href="/AlphabloxServer/theme/report.css">
</head>
<%
String reportName = portletResponse.encodeNamespace("myReportBlox");
%>
<bloxreport:report id="report" bloxName="<%= reportName %>" interactive="false">
<bloxreport:cannedData />
<bloxreport:filter expression="Sales < 100" />
<bloxreport:group members="Area" />
<bloxreport:sort member="Week_Ending" />
<bloxportlet:actionLinkDefinition action="selectProductCode">
<bloxportlet:parameter name="code" />
</bloxportlet:actionLinkDefinition>
<%
PortletLink link = report.getPortletLink("selectProductCode");
link.setParameterValue("code", "<value member=\"code\"/>");
String href = link.getLinkHRef();
String productLink = "<a href=\""+ href + "\"><value/></a>";
%>
<bloxreport:text>
<bloxreport:data columnName="Product" text="<%= productLink %>" />
</bloxreport:text>
</bloxreport:report>