Posts Tagged ‘Portlet’

Export from Displaytag inside a Portlet

Sunday, December 14th, 2008

The Problem:
When using Displaytag inside a Prortlet, the export functionality will not work because the portlet has no way to produce other than it’s portlet content for display (see http://jira.codehaus.org/browse/DISPL-344).
Since Displaytag export functionality produces downloadable content that the portlet container will interpret as a portlet render result, you will see the Displaytag output as HTML-rubbish.

The Solution:
When we came over this problem, a promising solution seemed to be the one described in this post:  http://www.jroller.com/hakan/entry/liferay_portal_4_1_2,  but nobody was able to get it running.
Based on the concept in this post I came up with the following simple idea: If the problem is, that the output is produced by something inside the portlet, than the solution is to produce the export result outside of the portlet. And it works.

It works like this:

  1. Disable the standard Displaytag export functionality
  2. Create a copy of your page and place it somewhere outside the portlet
  3. Add manually links to the copied page, providing the parameters required by Displaytag

Let’s look at this in detail on a concrete example:

(more…)