aspose file tools*
The moose likes JSF and the fly likes Alternative for displaytag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Alternative for displaytag" Watch "Alternative for displaytag" New topic
Author

Alternative for displaytag

Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
I have used displaytag in many of my applications. But now that I transferred to JSF i started doing some research and decided that maybe displaytag is not the right choice anymore. Displaytag is not developed anymore and there are many problems in integrating it to JSF (and more accurately to facelets since it is a jsp tag).

What I need is a tag library that allows me to do the the following:
-pagination
-exporting the html table to pdf and/or excel

I currently use JSF 2.0 (MyFaces implementation) and MyFaces Tomahawk with it.

Any suggestions?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16232
    
  21

Tomahawk has a table pagination control. So do most third-party extension tagsets, although pagination isn't part of the core JSF.

JSF is geared towards HTML output. Output in other formats (XML, Excel, PDF) are best done using servlets or JSPs, instead.

Customer surveys are for companies who didn't pay proper attention to begin with.
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
Thanks for your reply.

I am aware that many taglibs offer the pagination and even ordering of the table based on column data but I was hoping for a solution that offers both the html side and the other formats as well. Since I need the export option on multiple occasions, the fact that displaytag just created pdf or excel files with the data that would normally go to html table, was perfect for me. I understand that JSF mainly creates html but it can produce other kind of results if needed. If there is no good alternative for displaytag I will then try to use the displaytag itself or just implement the tags (or actions that produce the result I want) myself. If I produce the results myself (using iText probably with pdf files) I do have more flexibility with the outcome but it requires more work...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16232
    
  21

JSF is not greedy. You can safely use displaytags to output other page formats, but not on JSF pages (unless they are going to pop-up new windows).

In fact, you can even mix JSF and Struts in the same webapp. JSF takes over on JSF pages and stays out of the way the rest of the time. Since JSF backing beans are plain old J2EE properties, you can even communicate between JSF and JSP/servlet using session beans.
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
Yes, I can use jsp, normal servlets and struts etc if I like.

But I still need to know if there are alternatives to displaytag so If anyone has a knowledge of a good library or other means of doing the things it would be highly appreciated. And if anyone has made the displaytag work with JSF 2 that too would help me.
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
If anyone happens to need this I found multiple solutions. I just wasn't using google right...

Tomahawk
http://wiki.apache.org/myfaces/Exporting_DataTable_To_MS-Excel

IceFaces (data exporter)
http://component-showcase.icefaces.org/component-showcase/showcase.iface

PrimeFaces
http://www.primefaces.org/showcase/ui/exporterHome.jsf

...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Alternative for displaytag