This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes how to inform the total rows to trinidad table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to inform the total rows to trinidad table" Watch "how to inform the total rows to trinidad table" New topic
Author

how to inform the total rows to trinidad table

Jeya Balaji
Ranch Hand

Joined: Jan 02, 2003
Posts: 40
Hi,

I am using <tr:table> to list the data passed on from a bean. The range listener is working fine and I get the current start row. But if I pass only 25 (default number of rows per page), <tr:table> is displaying only those 25 rows and "prev", "next" links are missing. Is there a way to set the total rows to <tr:table>.

Let me go back to search more.
[ January 14, 2008: Message edited by: Jeya Balaji ]

Regards,<br />Balaji
Dushyant Agarwal
Ranch Hand

Joined: Oct 14, 2007
Posts: 75
Hi,
as far as I perceive your problem - Your navigation buttons disappear if your total number of records displayed in one page are all the there are to be displayed!!!

If this is the case then I think that there would be no need to apply navigation as no other records are there to navigate to. The <tr:table> component is intelligently removing the buttons to avoid ambiguity for the user..(I have tried this using standard JSF...It is very hard to achieve programmatically!!)
Jeya Balaji
Ranch Hand

Joined: Jan 02, 2003
Posts: 40
No, Dushyant. It is other way around. Let us say that I have 60 records, Instead of sending all at one shot, I want to send 25 at a time. Since I can get the starting row and number of rows per page, I can choose which 25 to send.

However, if I send 25, tr:table assumes that I have only 25 records (and hence doesnt allow me to navigate further). So, I want to tell tr:table that there are 60 rows in total.
Dushyant Agarwal
Ranch Hand

Joined: Oct 14, 2007
Posts: 75
Hi,
first let me clarify that I have never worled with tr;table before.

That is why I want to know:

if I send 25, tr:table assumes that I have only 25 records


Does this mean that in the value binding of the tr:table you are passing only 25 records at first attempt?? If so, then I would suggest you to pass
60 records altogether. Paging is provided intr:tbale I am sure it would show only the specified number of records in one page.
Jeya Balaji
Ranch Hand

Joined: Jan 02, 2003
Posts: 40
well, I dont want to load and pass all 60 when only 25 will be displayed. May be the number 60 is small enough to pass around. Assume the total number to be in thousands or millions. It wont be feasible to collect all records and send them for displaying only a small portion.

There should be a way to send only the records that would be displayed and the table asking for more records.
Dushyant Agarwal
Ranch Hand

Joined: Oct 14, 2007
Posts: 75
hi,

There should be a way to send only the records that would be displayed and the table asking for more records.


I don't think that the table is going to itself ask for more records until it knows exactly how many records are there to be displayed in total. I mean it is not going to request for more records. All it can do is display a fixed number of records at a time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to inform the total rows to trinidad table
 
Similar Threads
Defalut Selection in Tr Table Selection.
Pagination in JSF
Problem with Trinidad Nested Table (depth 3)
table and partial triggers
JSF and trinidad- Help with multiple iterations in a table