• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Alternative for displaytag

 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Saloon Keeper
Posts: 28102
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ilari Moilanen
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 28102
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

...
 
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic