The subject line was misleading, so resending the mail so that it would not
be missed out.
Regards
Kiran Kumar
________________________________________________________________________
Lead Life by Choice Not By Chance
-----Original Message-----
From: Kiran Banda
Sent: Tuesday, October 26, 2004 9:37 AM
To: [EMAIL PROTECTED]
Subject: RE: [displaytag-user] List contains only a subset or limited reco
rds
Hi Friends,
I have just started using the displaytags and found it really really
interesting. The pagination and sort features are simply superb. I have one
observation with this tag library. I am developing a struts based web
application and I would like to have the column header to show the locale
specific titles and not the hard-coded strings. I mean to say, that display
tags should support i18n (internationalization). When I say i18n, struts
tags support i18n.So I prefer using the struts resource bundle instead of
writing a different one altogether.
Solution: I tried extending the display tag library as follows so as to
support i18n.
1) A new interface named ResourceProvider is added that has one method
"String getMessage()"
2) I have implemented this interface and named it
StrutsResourceProvider.This resource provider picks up the keys from the
struts resource bundle. If somebody likes to use a different resource
bundle, then just simply implement ResourceProvider interface.
3) The table tag is changed to have a new attribute named
resourceProvider.This attribute expects the fully qualified name of the
class that implements ResourceProvider (eg:-
com.myCompany.StrutsResourceProvider)
4) Now in the column tag, I have added one attribute named resource.The
possible values for this are true|false.
How it works ?
Lets say that the resourceProvider is set properly on the table
tag.Now if the "resource" attribute of the column tag is true, then the text
that we give for the "title" is considered as the resource key.If the
"resource" is false, then the text for the "title" is taken as is.This way
we are allowing the user to give hardcoded strings as titles if need be.
Please let me know if you have any better ideas in this regard. For any
further help, mail me back.I shall help you out.
Regards
Kiran Kumar
________________________________________________________________________
Lead Life by Choice Not By Chance
-----Original Message-----
From: Jason Lee [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 26, 2004 4:24 AM
To: [EMAIL PROTECTED]
Subject: RE: [displaytag-user] List contains only a subset or limited
records
This is interesting because I just started working on
the search section of my site and I know I'm going to
run into this issue soon.
The more I think about the 'empty object' approach, I
don't see why it won't work - for navigation.
However, you'll run into issues sorting columns and I
suppose it might make sense for scrollable results to
just turn sorting off. Can still leverage all the html generation which
would still be good.
Anyway, interesting idea, thx.
- Jason
--- Justin James <[EMAIL PROTECTED]> wrote:
> Rajesh,
>
> I'm still fairly new to display tag, but one of the
> reasons we like it
> is because display tag allows us manage the list
> outside the paging
> presentation framework. Display tag determines the
> paging presentation
> based on the size of the collection, but does not
> know anything about
> how the collection is built. So, if you pass it
> only 10 items in the
> collection, it will think there is only one page and
> provide
> presentation accordingly - page 1 of 1 (assuming a
> 10 item page size).
> Basically, the functionality you want is not in the
> scope of display
> tag.
>
> However, it occurs to me that you might get the what
> you need by
> creating a custom list builder. This list builder
> might do something
> like...
>
> 1. get total number of records (e.g. 100 items)
> 2. get the records for the current page (you will
> need to intercept the
> display tag parameters to know this information, and
> I'm not sure how
> that might be done).
> 3. Build the collection by padding the current page
> (items 11-20) with
> empty objects (e.g. items 1-10 empty objects, 11-20
> real objects, 21-100
> empty objects). This allows the paging display and
> counting to function
> correctly.
>
> Somewhat of a crazy notion I know, but it just might
> work. :-)
>
> HTH,
> Justin
>
>
>
>
>
> -----Original Message-----
> From: Rajesh Punjabi
> [mailto:[EMAIL PROTECTED]
> Sent: Saturday, October 23, 2004 1:05 AM
> To: '[EMAIL PROTECTED]'
> Subject: [displaytag-user] List contains only a
> subset or limited
> records
>
>
>
> Hi All
>
> This my first email to the group and I am just
> about to start
> using the Display tag.
> I have a specific requirement for which I need some
> pointers for
> changing/using the display tag for my application.
> Some of the result sets which need to displayed to
> the user may
> be very huge and I don't want to get all the records
> from the DB at one
> go. So I fetch only a subset of records from the
> DB; for instance I may
> get only 11 records to display the first 10 (the
> 11th record is to just
> determine if I should show the next link)
>
> Can someone please help me on how the display tag
> can be used
> for this.
>
> Thanks
> Rajesh
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use
IT products in your business? Tell us what you think of them. Give us Your
Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
displaytag-user mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
_
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail and delete
the message and any attachments from your system.
This message is confidential and may also be legally privileged. If you are
not the intended recipient, please notify [EMAIL PROTECTED]
immediately. You should not copy it or use it for any purpose, nor disclose
its contents to any other person. The views and opinions expressed in this
e-mail message are the author's own and may not reflect the views and
opinions of ADP.
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use
IT products in your business? Tell us what you think of them. Give us Your
Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
displaytag-user mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user