Hi, I am doing something that is sort of similar.
I have a sorted display:table with an Excel export option and I want to put some cell references in the excel output. I can workout the column, A, B, C etc from where I position the column in the display:table, but the row is trickier, rowNum seems to be the pre-sorted row number. For example, my collection has in it: Name3 Name2 Name1 But I have a sort on Name, I get this output: RowNum Name 3 Name1 2 Name2 1 Name3 If I maintain a variable in the jsp, it is evaluated in the pre-sorted order and so results in the same numbers. I am handling this for now by removing the sort and using rowNum. I guess I will need to do the sorting in the code that produces the collection. I have already disabled the ability of the users to re-sort, so that does not cause any further issues. I am assuming, especially from this and other posts that display:tag has nothing that would help me with this. Thanks in advance for any thoughts. Chris -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Pratt Sent: 12 April 2008 00:40 To: displaytag-user@lists.sourceforge.net Subject: Re: [displaytag-user] [displaytag - Help] Stop rowNum from changing upon table sort On Fri, Apr 11, 2008 at 3:17 PM, SourceForge.net <[EMAIL PROTECTED]> wrote: > > Read and respond to this message at: > https://sourceforge.net/forum/message.php?msg_id=4900159 > By: goelshek > > I am using pagination+sorting with the id_rowNum feature of > displaytags. The resultant table might look like: > > ROW USER NAME > 1 Name1 > 2 Name2 > 3 Name3 > > When I click on the USER NAME header to sort, and assuming the table > is sorted in descending order, the table now looks like: > > ROW USER NAME > 3 Name3 > 2 Name2 > 1 Name1 > > Is there a way to stop the first column from being tied up with the entire > table? > I want the rowNum to stay in order but everything else gets sorted. > Does anyone have a solution to this? > > Thanks. You'll probably have to manage those numbers yourself. DisplayTag doesn't store what number goes with what row, it just increments a counter while it's building up the table and passes that value on. So if you want the row numbers to be part of the data, you'll have to treat it that way. (*Chris*) _______________________________________________ displaytag-user mailing list displaytag-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-user _____________________________________________________________ This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. If this email contains an offer, that should be considered as an invitation to treat. _____________________________________________________________ ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ displaytag-user mailing list displaytag-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-user