Discussions

News: Display tag reduces pain of JSP development

  1. JSP development can be a bit "cumbersome". A diffuse set of often fairly limited tag libraries abound. It's therefore surprising that the open source display: tag library has gotten so little attention. This gem is a mature renderkit for all sorts of lists, ideal for overview-detail screens. It supports sorting, grouping, alternate row colors, export functions and decorators to fulfill most if not all of your display needs. And, it looks cool.

    I would say that this tag library reduces backoffice development time by 10% if not more, what do you think?

    http://displaytag.sourceforge.net/

    Threaded Messages (70)

  2. scaleability[ Go to top ]

    The last time I looked at this it had an underlying problem were the entire result set had to be loaded into memory to provide the features it offered. As opposed to paging from the data base via a value list pattern.
    Is this still the case?
  3. was wondering the same thing[ Go to top ]

    I would also like to know if this is still the case ?
  4. i tried it long back and left it. The best option is JSTL = way better than this fancy one which doesnt work most of the times. one of those open source projects which start with a bang and kind of hang out on sourceforge for years with no real progress.
  5. JSF Is the Answer![ Go to top ]

    JSF also has this same capability with EL support built in. Since JSF abstracts the data, the view can be backed by a collection, iterator, or even a RowSet if you choose.

    Also, you can then incorporate additional functionality into your table views such as buttons that launch a detailed view of a particular item, or easily incorporate checkbox features like delete selected, or add selected to basket.

    It's really kind of cool how it works!

    Go download the JSF 1.1 RI from Sun and take a look at their 'component' sample application for some really cool features with minimal coding while leveraging the same EL you use with JSTL.

    As a side note, JSF is a view-oriented technology and can be utilized with other existing MVC frameworks on a case by case basis if you choose.

    Jacob Hookom
    McKesson Medical-Surgical
    JSR 252-EG
  6. JSF Is the Answer??[ Go to top ]

    I'd be interested, but a few months ago at the Columbus NFJS symposium, David Geary said that the JSF view components for displaying lists didn't handle sublists yet. Was he incorrect or has this been improved since then? Sublist support is critical for scalability.
  7. JSF Is the Answer??[ Go to top ]

    I'd be interested, but a few months ago at the Columbus NFJS symposium, David Geary said that the JSF view components for displaying lists didn't handle sublists yet. Was he incorrect or has this been improved since then? Sublist support is critical for scalability.

    What kind of behavior are you expecting from sublists? Just displaying them? I know that the current JSF components do allow for recursive processing of children.
  8. JSF Is the Answer??[ Go to top ]

    I'd be interested, but a few months ago at the Columbus NFJS symposium, David Geary said that the JSF view components for displaying lists didn't handle sublists yet. Was he incorrect or has this been improved since then? Sublist support is critical for scalability.
    What kind of behavior are you expecting from sublists? Just displaying them? I know that the current JSF components do allow for recursive processing of children.

    No, by "sublist" I mean just one page of the list. Does the JSF view component allow you to pass the user's page number (or index), rows per page and sort order back to the supporting data source so that sorting and paging can be done down low? If not, then it's doing exactly what Displaytag is doing - loading the entire result into memory before displaying even a portion of it. It does look like you can hand it a java.sql object, but that's worse - essentially throwing MVC and SOA out the window.

    ...SUN's demo of JSF's component doesn't look too pretty either - have a look at Displaytag's front page for a comparison.
  9. JSF Is the Answer![ Go to top ]

    This taglib also accepts collections for the source:
    http://www.servletsuite.com/servlets/gridtag.htm

    and EL support is a standard feature of JSP 2.0 of course

    Dmitry
  10. i tried it long back and left it. The best option is JSTL = way better than this fancy one which doesnt work most of the times. one of those open source projects which start with a bang and kind of hang out on sourceforge for years with no real progress.

    Well, it isn't perfect, but we use it and like it. It does work and we've had good success with it.
  11. Yep, that's still the case - Displaytag needs to process the entire result set. It's been an issue for over a year, and people have even submitted several patches, but nothing has yet been done according to their Jira. Quite a shame considering how nice the library is otherwise, but you just can't use it in cases where the overall result set is going to be big. For that reason alone, some people like ValueList (http://valuelist.sourceforge.net/team-list.html) better, but I haven't checked into it in several months to see how the project is going.
  12. to process the entire result set.

    Maybe you should try leverging MVC, where Model, DAO or SQL does pagination, not View. Ex: iBatis pagination. Also some newbies have an idea that rows stream from JDBC. Try it w/ your driver, and tell me wrong!

    Most tech leads frown on doing data maniplation in View or tags, so I can't see why it would even get listed as a bug or RFE.

    .V
  13. Maybe you should try leverging MVC, where Model, DAO or SQL does pagination, not View. Ex: iBatis pagination. Also some newbies have an idea that rows stream from JDBC. Try it w/ your driver, and tell me wrong!Most tech leads frown on doing data maniplation in View or tags, so I can't see why it would even get listed as a bug or RFE..V

    Display Taglib is nice because it's so simple and using it doesn't mean your are avoiding MVC (the C is the tag itself).
  14. the C is the tag itself

    I see, in the JSP tag you say. OK if you say so.
    You can use it any way you want.

    1up.com we use that tag as View, for example you can see top 10 games.
    .V
  15. to process the entire result set.
    Maybe you should try leverging MVC, where Model, DAO or SQL does pagination, not View. Ex: iBatis pagination. Also some newbies have an idea that rows stream from JDBC. Try it w/ your driver, and tell me wrong!Most tech leads frown on doing data maniplation in View or tags, so I can't see why it would even get listed as a bug or RFE..V

    If you haven't gotten it yet, that's exactly the problem with Displaytag - it needs to load the entire result list to determine how to sort it and what part of it to display. It's no big deal with a few hundred or even a few thousand rows, but pulling tens of thousands just to display a small screenfull is inherently unscalable. In short, Displaytag doesn't have the ability to pass index, maxRows and sortColumn to the backing service/DAO stack.

    I agree with the other posters about Displaytag's usefulness - I used it on a project last year and was truly impressed with how easy it is, how nice it looks, its ability to export to Excel, CVS and XML, etc. I guess that's why I'm being so vocal about it needing sublist support - to give it the scalability it desperately needs.
  16. It's no big deal with a few hundred or even a few thousand rows, but pulling tens of thousands just to display a small screenfull is inherently unscalable.
    I have yet to see a use case where the user NEEDS to have tens of thousands of rows available at once. Depending on the page size, this would mean thousands of pages. What user needs to go to e.g. page 1623?
    The obvious solution to this problem of size, is to enforce user selectable filters, which both improve scalability and makes it easier for the user to manage the volume.
  17. Maybe you should try leverging MVC, where Model, DAO or SQL does pagination, not View.

    I couldn't agree more. I just use collections to feed Displaytag, and let the database or the DAO deal with pagination. For me, Displaytag is highly customizable and stable, and does a perfect match with JSTL.

    Javier
  18. No MVC with Displaytag[ Go to top ]

    Maybe you should try leverging MVC, where Model, DAO or SQL does pagination, not View.
    I couldn't agree more. I just use collections to feed Displaytag, and let the database or the DAO deal with pagination. For me, Displaytag is highly customizable and stable, and does a perfect match with JSTL.Javier

    I'm sorry, but you are completely missing the point. Displaytag doe not let you implement a sensible MVC architecture, because all the logic is coded into th view itself. For reordering for example, the displaytag code will read the complete dataset into memory, every single row, regardless of what your collection implementation or DAO or whatever does in the background. Let me repeat: every single row is read from the database. After that, sorting is performed on the full dataset in the application (the displaytag code), rather than the database. Similarily, for pagination, every single row up to and including the page to want to display is read from the datasource.<br>All this is highly ineffective and of course not scalable.<br><br>
    I have looked at displaytag in the past and even spent some time retrofitting a sensible pagination and sorting solution (which is not even very difficult), but eventually decided to use tapestry, which I'm very happy with.
    <br>
    M.
  19. No MVC with Displaytag[ Go to top ]

    Hi!
    I'm sorry, but you are completely missing the point.

    Ups ;-) Actually I think you missed *my* point
    Displaytag doe not let you implement a sensible MVC architecture, because all the logic is coded into th view itself.

    I disagree. the way I see is: "displaytag has view logic coded into itself"
    For reordering for example, the displaytag code will read the complete dataset into memory, every single row, regardless of what your collection implementation or DAO or whatever does in the background.

    I agree, and see that as a good point of the component. It is not intrusive with the way you code things in the "M".
    Let me repeat: every single row is read from the database.

    I disagree. Just a little ;-) Look, I don't think it makes much sense for a user to iterate over thousands of records on web pages. I don't think either that makes much sense for a programmer to fetch thousands of records from database just for display hundreds of them in the screen.

    So summaryzing:

    1) I think displaytag if for use just with small lists
    2) If there are thousands of records, I filter/paginate on the database, extracting only a subset of them: *no need to deal with whole and huge resultsets*
    3) So I disagree with the claim that displaytag doesn't fit in an MVC. To me it's just a view component.


    Cheers
  20. No MVC with Displaytag[ Go to top ]

    Duh!

    Forgot to say that I wholeheartly agree with you is in the scalability problem, even with small collections if the application will be concurrently accessed for more than a few users.
  21. to process the entire result set.
    Maybe you should try leverging MVC, where Model, DAO or SQL does pagination, not View. Ex: iBatis pagination. Also some newbies have an idea that rows stream from JDBC. Try it w/ your driver, and tell me wrong!Most tech leads frown on doing data maniplation in View or tags, so I can't see why it would even get listed as a bug or RFE..V

    The last time I checked in it's 'original' form (aka w/o hacks) it needed the entire result set from db to do pagination correctly. So you see, if you already do pagination at data retrieval level (Hibernate has that capability also) the display tag won't know how many pages you have, the current page etc. It will display a single page, that one you retrieved.

    That's what I understood it, however, if I am wrong, somebody correct me so that I don't spread FUD, it is not my intent at all. Actually I like everything else at the display tag. But I don't see how will it scale to display pagination for a search result set of 800.000 rows if I have to load them all ... (yes I know, why don't you use cache etc... there is reason for that too)
  22. But I don't see how will it scale to display pagination for a search result set of 800.000 rows if I have to load them all ...

    Who ever wants to display 800.000 rows (40.000 pages/ 20 rows per page) to its user????? Normally you will have a nice search option which will find only the matching subset. And if the resultset is still to big ( > 1000 rows)the user will be asked to refine the search.

    Isn't this a more usefull design pattern? Maybe it would be a great idea to implement this design pattern as part of DisplayTag....

    I'm using displaytag and am very fond of it. Its saves you a hell lot of time.

    Murat
  23. Who ever wants to display 800.000 rows (40.000 pages/ 20 rows per page) to its user?????

    Ummmm, did you ever hear about the word 'customer' ? They want it.

    Ever heard about google ? Not that I'm developing ever something closed to it, but believe me there are cases when what I have said apply. If you didn't see it it doesn't mean it's not there.

    And even for 1000 records as you say you won't convince me to stick the shit into the HTTP session so that the bloody tag works. The only option acceptable, in this case, to me would be to retrieve the data out of some application cache (application cache, not session).
  24. Who ever wants to display 800.000 rows (40.000 pages/ 20 rows per page) to its user?????
    Ummmm, did you ever hear about the word 'customer' ? They want it.Ever heard about google ?

    Sorry, even Google doesn't retrieve all the results. It counts them and shows just some of them. Have you ever looked at some searches where Google says there are 6 pages, and when you arrive to the 4th or 5th page, then suddenly the page counting is reduced and then google tells you it omitted some no so relevant results?

    OTOH I understand for a user 800,000 records are relevant... on a OLAP cube. If your user insist you on retrieve 800,000 records for watching them on screen, and you are fetching all of them from the database/cache, you already have a harder problem than using displaytag.

    Cheers
  25. Ever heard about google?
    When have you ever gone beyond page ... say ... 35 in Google? I don't care if they show 1 million hits, there's no way I have ever looked beyond page 20. If there are that many hits and you can't find what you're looking for in the first few pages, what do you do? Yes that's right, you add more search words to limit the scope.
  26. Has anyone been able to apply the Display tag to display as well as edit rows of data?
  27. Editable lists with Display tag[ Go to top ]

    Yes, but I implemented this by adding a check box, and providing an edit button that took you to a page where you could edit the details of the selected record
  28. Adding checkBox for Display Tag[ Go to top ]

    Hey,

    Can u plzz let me know how u have implemented checkBox functionality for Display Tag ...

    Thanks,
    Phani..
  29. Adding checkBox for Display Tag[ Go to top ]

    Hey,Can u plzz let me know how u have implemented checkBox functionality for Display Tag ... Thanks,Phani..

    Use decorator:

    For Ex:
    //Method in decorator
        public String getAnimalCheckBox()
        {
          ManageAnimalsBean object = (ManageAnimalsBean) getCurrentRowObject();
          String animalKey = String.valueOf(object.getAnimalKey());
          String value = "<INPUT TYPE=\"CHECKBOX\" NAME=\"animalKey\" VALUE=\""+ animalKey +"\">";
                          //"<INPUT TYPE=\"HIDDEN\" NAME=\"animalKey\" VALUE=\"" + animalKey + "\"> ";
            return value;
        }


    //Using in jsp

    <display:table class="simple" name="animalsList" decorator="com.gam.gcms.util.GCMSTableDecorator" align="center">
      <display:column property="animalCheckBox" title="" />
      <display:column property="animalVID" title="VID" />
      <display:column property="animalEID" title="EID" />
      <display:column property="animalDOB" title="Birth Date" />
      <display:column property="animalBirthType" title="Birth Date Type" />
      <display:column property="animalSex" title="Sex" />
      <display:column property="processName" title="Process" />
    </display:table>

    Hope this helps you.
  30. Hi,
    I am using a display tag for pagination in my JSP page. I have a checkbox field as one of the columns. I am using displayTagWrapper class to display my checkboxes. I have a submit button in a page which will save checkbox status into the database. I also have pagination and sorting in the page.

    The problem i have is, i will loose the status of the checkbox when i go to second page. If i select some of the checkboxes in page 1 and go to page 2 to select some more and if i come back, i loose all the selected checkboxes in page 1.

    Is there a way where i could save my check boxes in session and its checked while i browse across pages and gets submitted all at once.

    Any help is appreciated

    Thanks
  31. Ever heard about google

    Ever searched for the word "java" in google? How many hits do you get? Lets try..
    "Results 1 - 20 of about 103,000,000 for java"

    Lets click through the result pages... Whoops.. it doesn't go further than page 45!!

    The developers of Google are smart enough to understand that a user never will look at ALL THE 103 million pages....

    Try to really have a good understanding in your users requirements. Sometimes users demand things they actually never want...

    (Sorry for the late reply)
  32. Who ever wants to display 800.000 rows (40.000 pages/ 20 rows per page) to its user????? Normally you will have a nice search option which will find only the matching subset. And if the resultset is still to big ( > 1000 rows)the user will be asked to refine the search.Isn't this a more usefull design pattern?

    In our case, we are displaying the contents of web sessions as cascading paginated lists. In other words, the user can start with a list of web sessions (which could be a very long list - on the order of hundreds of thousands) sorted by time and / or with a narrowing set of criteria (for a smaller list). However, there is a perfectly valid business case for the user to ask for a list of all sessions in the last 2 days (and we estimate this set could represent up to 100,000 sessions @ 50,000 users per day) sorted by time in descending order (i.e., most recent first).

    Then the user can select a session and drill down to see its pages. Normally, this shouldn't represent a large row set. However, some customers have automated applications that interact with their web sites every few minutes and never stop. That represents a "user" with a session that lasts for days and produces hundreds of page hits every day. If each page had 10 embedded objects (i.e., graphics, etc), a css file, a javascript file and at least one redirect (either for the page or one of the embedded objects), then your talking about a session that generates thousands of actual hits every day.

    And our customers want to be able to see those hits in the context of the session that generated them with all of the usual bells and whistles (i.e., sort by time, by size, etc).

    It's not the standard business application, I know. But its requirements blow the standard solutions out of the water.

    All of this to say, "Never say Never". The minute anyone says, "Who would ever want that?" or "That'll never happen", it is almost guaranteed that the problem you were just commenting on will actually occur (I'm sure there's a natural law that says things will happen the minute you deny them).

    My personal experience in the projects that I've worked on has taught me to design and code defensively as a matter of habit. Once that happens, you will rarely be caught off guard by unusual or last-minute requirements.

    Just a cautionary note to others in this business.
  33. However, there is a perfectly valid business case for the user to ask for a list of all sessions in the last 2 days

    Hmmm, so your user wants to SEE all 800.000 pages. Suppose your user is looking only 10 seconds long to each page. It will take .. yes it will take this smart user 111 hours to have a look at ALL the pages... This is a valid business case? Valid maybe, but not a smart one...
    A good information analyst will always ask "why" to its user who demands for such requirements. I'll bet that this is not what the user REALLY wants. To understand the actuall needs you will have to ask him "why". Always ask "why"...
    However, some customers have automated applications that interact with their web sites every few minutes and never stop. That represents a "user" with a session that lasts for days and produces hundreds of page hits every day.
    I always thought web based solutions were meant for human users only....

    Murat Dönmez

    (sorry for the very late response)
  34. Maybe you should try leverging MVC, where Model, DAO or SQL does pagination, not View.

    Paging is an entirely view related issue, which is where it belongs.
    Also some newbies have an idea that rows stream from JDBC. Try it w/ your driver, and tell me wrong!
    You're wrong. For example, Sybase and MS SQL Server use a streaming wire protocol, which is a lot different from the packet based protocols.
  35. I used displaytag for several months,and it needs to process the entire result set,but i think it's unacceptable put several thousands result sets to memory once.
    so i use other taglib:
    Pager Tag Library for pagination,and displaytag only display the table data.everytime only return several records such as:20 to displaytag,and displaytag display all records received.

    of couser,this solution need more coding to implement the pagination.but i think it's worthy.
  36. scaleability[ Go to top ]

    The last time I looked at this it had an underlying problem were the entire result set had to be loaded into memory to provide the features it offered. As opposed to paging from the data base via a value list pattern.Is this still the case?

    The primary objective for 1.1 is to enable partial loads. The work is a little tricky, because DT supports sorting on a generated column body, so there will be some situations where a full list render is still required.
  37. Display Tag Success![ Go to top ]

    I have used the Display Tag for several corporate web applications and have had tremendous success with it. While rendering a table from a List is easily reproduced with JSTL, JSTL cannot match the added services of the Dislay tags. Export to Excel, sorting, and paging are available as simple configuration options. The look and feel can be controlled by adding custom styles.

    The libraries are well documented and very stable in my opinion. While I do agree that reading the entire list into memory may be unacceptable for some applications, this library works great when you are dealing with small to medium result sets. I have been tracking several proposals in the Jira database that address this issue. Based on the past performance of the development team, I am confident that an elegant solution will be available soon. In fact, Jira indicates that a Value List style paging option will be available in the next release.

    I appreciate all the hard work that has gone into this library and it has saved me countless development hours. If you haven't tried the library, give it a chance. I believe you will be pleased with the results. Just as with every framework, it isn't the right solution for every application but is does what is does very well. If you don't like all the functionality, solve the problem yourself and contribute the code so that we can all benefit from it.
  38. Display Tag sorting[ Go to top ]

    Hi

    Display Tag doesn't sort the fields that appear to be numeric or of Date format.
     
    I was needing some help regarding the same.
     
    My problem goes like this--
    I'm designing a reporting tool for my firm here for which I'm using the DisplayTags. Since its generic in nature, the fields are unknown at the jsp in which I'm including the DT. All the fields I'm getting are in String format, since the underlying Bean itself is generic and renders itself to the DT with all String Fields of data.
    Now I need to sort the columns depending on the sorting option specified in some XML which I'm able to do. But sorting for date and numeric fields fail.
     
    Kindly suggest what should I go for.
     
    Thanx
    --Nagraj.
  39. Displaytag and dynamic columns[ Go to top ]

    Hi! I am trying to display dynamic columns using display tag. and trying following code with JSTL, but it does not work:( In above code, "dataRowList" is the java.util.List of String objects across the row. Anyone has used displaytag to display dynamic columns? Any help would be appreciated. Thanks, Anil G
  40. Re: Displaytag and dynamic columns[ Go to top ]

    I got that working, the only problem is value binding with "title" ? anyone who knows how to dynamically assign values to title? Any help would be appreciated. Thanks, Anil
  41. For small to medium ResultSets, this tag has worked really well. It is simple to use, configure and it looks good too. The Export feature has been very useful to us and it saved quite a bit of development time. We have it in deployment and so far we have no issues. It may not fit everyone's requirement but it is so simply to setup and use, then you can quickly insert it and determine for yourself if it is ok.

    For quick prototypes too, this tag is very handy.
  42. DisplayTag is definitely a shining example of a useful JSP tag, but how useful is JSP itself? There has been a techtalk interview with Howard Lewis Ship (the "father" of Tapestry) where he explains why JSP is a pain in the neck. It is explained in, even more, detail in the Tapestry reference manual.

    Having extensively used JSP as the UI layer of MVC, I can not help agreeing with Howard. JSP has far outdated itself and it plain SUCKS.

    I think, for the UI only, the Tapestry approach is faaaaaaaaaaaar better. I have some other issues with the Tapestry but as far as UI goes - JSP is clearly not my favorite.

    P.S. With all due respect, I am surprised to see Display Tag in the news section. It may have place in forum, but what's new about the display tag? :) It feels like it has been around for ages ;)
  43. Reading all this posts I ask myself if all those people have really tried the tool. I am using DisplayTag in a large project, I am REALLY satisfied, and it does all the things that I read in this posts it can't does !!!!!
  44. One the issues I have with displaytag is how it sorts, it sorts the current page and not the collection. If I choose to sort by a column, I'd want to sort the whole collection not just the data I'm looking at just like ebay lets you sort by price.

    Valuelist is a better option, but it takes longer to integrate - displaytag is by far the simplest way of getting sorted tables into your application. In our company we have standardised on hibernate for all persistence and we use it's inbuilt paging to take care of creating the sublists and the sort order across the whole collection. We didn't gain much over valuelist, but we can refine the sublist generation better.

    Thx to the displaytag developers though, we do will use it for some projects and especially for demos. For that purpose it has saved a lot of time.
  45. You can configure that behavior in the table tag.

    See the "sort" property in the documentation http://displaytag.sourceforge.net/tagreference-displaytag-12.html

    For small/medium lists I recomend the display tag, it's easy to learn and use.
  46. If you refere back to documentaiton, you will an attribute avaialbe to change sorting behaviour.
     sort ="list" // sort the whole list (result set)
     sort ="page" // sorts only the data appears on page
    Give it a shot

    Jamshaid Ashraf
    DPS (www.d-p-s.com)
  47. I used DisplayTags on a project a couple of moonths ago and found it lacking features I needed.
    For one, it didn't handle checkbox or radionbuttons when pagination/sorting was turned on. Selections where lost when paging/sorting.

    Found some work arounds with JSP and hidden fields for some of the problems but rememmber that some other problems weren't solved.
  48. Hi,
    I need to display all the attributes of the object that I get from the backend in one column, wrapped to multiple lines. Is it possible using displayTags?
    Last time I tried, the displayTags table mapped each attribute to each column in the display.

    Your comments are appreciated.

    Thanks,
    Archna
  49. I personally think JSP is a pain in itself. Mixing presentation layout and logic is never a good idea. To avoid enormous problems in the maintenance of bigger applications the only way is to switch to a "push" model instead of pulling in data into the HTML page. This way you can get a clean separartion between skins (CSS), layout (HTML), presentation code getting the data from the business logic and pushing it into HTML. Then you still can use your favorite HTML editor to write HTML and have programmers doing the programming work. Good choices using this appraoch are ENhydra XMLC and the Barracuda MVC library.

    Alfred Madl
  50. Old JSP was a pain..

    In JSP 2.0 you can avoid doing this mixing. The advantage is that defining tag files is very simple. Even simpler than defining new tapestry components. So you get procedural abstraction without having to out.print() statements.
  51. Displaytag and sorting[ Go to top ]

    I use displaytag a lot and I think it is excellent component but there are some issues when it comes to sorting.
    Displaytag compares two strings using default compareTo method and there is no way to specify another Comparator. For exapmple, it is difficult to compare formatted dates (they are compared as Strings) or to sort case insensitive Strings or to use non-English sorting order. When I needed that for my project, I had to modify displaytag source to add custom coparator per column option but now I am stuck with version I modified (beta 2 or something like that). I sumbmitted those modifications as patch, but they didn't got into 1.0 version.

    Regards,
    Dejan
  52. Displaytag and sorting[ Go to top ]

    I use displaytag a lot and I think it is excellent component but there are some issues when it comes to sorting. Displaytag compares two strings using default compareTo method and there is no way to specify another Comparator. For exapmple, it is difficult to compare formatted dates (they are compared as Strings) or to sort case insensitive Strings or to use non-English sorting order. When I needed that for my project, I had to modify displaytag source to add custom coparator per column option but now I am stuck with version I modified (beta 2 or something like that). I sumbmitted those modifications as patch, but they didn't got into 1.0 version. Regards, Dejan

    You can use a decorator that wraps the string in a comparator and returns the string in the toString method to achieve what you are wanting to do here.
  53. Displaytag and sorting[ Go to top ]

    FWIW, both of these fixes were committed into HEAD for 1.1 in January. We still need to post the a 1.1 build, but you can just use the latest out of CVS.
  54. Displaytag and sorting[ Go to top ]

    Thanks a lot. I really need this feature. Hope 1.1 will be released soon

    Dejan
  55. Displaytag and sorting[ Go to top ]

    ...but there are some issues when it comes to sorting...

    There is one more issue. I am not sure, if anybody has already faced it and has a solution ready. If yes, please update me.
    The problem is like this:
    When a user is seeing page no., say 3, and he wants to update any of the records on this page. After he updates and saves the record, it is expected that he comes back to PAGE NO. 3 again. But, oops, he sees that he is now on PAGE NO. 1. He does not see his just-now-updated record (unless, of course, the query has "ORDER BY LAST_UPDATED")! Does it not sound absurd? I wish if somebody has observed this behavior.
  56. Displaytag and sorting[ Go to top ]

    One more problem I faced was of "refreshing the list page after 'creating' a record".

    I am using DT with Struts. When the user 'creates' a record, he is taken back to the LIST page (which uses DT) with new value added in the list. If by any chance, user presses F5 or refreshes the page, he sees the 'create' page again and that too with an error msg :(. Since I have a DB constraint for duplicate records, the page shows an error msg saying:
    "The record with this <value> already exists. Duplicate record error."

    I guess, using the "POST-REDIRECT-GET" pattern posted on TSS some time back could be the ONLY answer to my problem (it works!).

    Thanks
    -Prasad
  57. Displaytag and sorting[ Go to top ]

    One more problem I faced was of "refreshing the list page after 'creating' a record".I am using DT with Struts. When the user 'creates' a record, he is taken back to the LIST page (which uses DT) with new value added in the list. If by any chance, user presses F5 or refreshes the page, he sees the 'create' page again and that too with an error msg :(. Since I have a DB constraint for duplicate records, the page shows an error msg saying:"The record with this <value> already exists. Duplicate record error."I guess, using the "POST-REDIRECT-GET" pattern posted on TSS some time back could be the ONLY answer to my problem (it works!).Thanks-Prasad

    This can be avoided by changing "redirect" to "forward" in Action classes.

    Jamshaid
    DPS
  58. Displaytag and sorting[ Go to top ]

    While I am using the sorting in display tag how do I get to display the small arrows to show the sort type like ascending or descending? Can someone pls help me with this.

    Thanks in advance.
    Praveen
  59. Displaytag and sorting[ Go to top ]

    While I am using the sorting in display tag how do I get to display the small arrows to show the sort type like ascending or descending? Can someone pls help me with this.Thanks in advance.Praveen

    Did you ever get an answer to this?
    Megan
  60. Displaytag and sorting[ Go to top ]

    try to see the path of pictures in the css...
  61. Displaytag and sorting[ Go to top ]

    Hey,

    i'm having a problem, i would like to use displaytag to show only a register but not in collums...like this:

    not:

    Name Surname
    José Mourinho

    ok:

    Name José
    Surname Mourinho

    Thanks,
    Paulo
  62. Don't Use for Sorting[ Go to top ]

    This library has a huge architechtural problem when it comes to sorting. It first processes the contents of each column tag, and then sorts that. Which is not always what you want. Unfortunately it does not provide a direct mechanism to handle the sorting externally. You have to sort the results in your model and then pass it to the column.
  63. It is not an good idea for sorting the coloums with display tags.Instead we can look for Javascript sorting from client side(ofcourse this is possible).Because the the same query is executing again and again in server when clicks on sorting head, if we keep the bean in sesion it is the overhead for server.
     Follow the url :http://www.pbdr.com/jscript/tblsort.htm

    Regards,
    Mahendran..
  64. It is not an good idea for sorting the coloums with display tags.Instead we can look for Javascript sorting from client side(ofcourse this is possible).Because the the same query is executing again and again in server when clicks on sorting head, if we keep the bean in sesion it is the overhead for server.&nbsp;Follow the url :http://www.pbdr.com/jscript/tblsort.htmRegards,Mahendran..

    Does the code you mentioned work for Mozilla/FireFox? For me, it worked on IE but not Mozilla.

    Thank you.
  65. Cross-browser client-side sorting[ Go to top ]

    Here's a demo of client-side table sorting that should work in most browsers.

    http://raibledesigns.com/page/rd?anchor=client_side_sorting_with_the

    Matt
  66. An alternative: ValueList[ Go to top ]

    ValueList is another open-source that does the same and I believe it to be more flexible. See http://valuelist.sourceforge.net/
  67. DisplayTag saves times[ Go to top ]

    I think DisplayTag is one of the best apps I've ever come across. Things I'd spent hours coding in PHP like sorting and pagination worked perfectly the first time I'd used it. Everytime I want some other feature, I find out they've already implemented it. There's a few annoyances I've come across, but this app really should be getting more recognition. As far as displaying large result sets, if you're using a service like hibernate you could just lazy load the results, no?
  68. DisplayTag saves times[ Go to top ]

    As far as displaying large result sets, if you're using a service like hibernate you could just lazy load the results, no?

    I've taken this approach before but it only improves the performance of loading lazy sub-sets, not the primary objects' properties - the full set of those are always fetched before Displaytag can sort them.
  69. In representation level of application, we also need List.. to work with us.
  70. Is there a way to show a photograph in between the rows using display tag?

    Thanks,
    Keith
  71. the tag is not perfect at present[ Go to top ]

    I also use it in several app.
    I believe it will be a perfect module in future.