• Post Reply Bookmark Topic Watch Topic
  • New Topic

Datatable and link problem

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I found that by putting a link in datatable and clicking it causes the get list for datatable to be executed again. This also happens to any links and buttons that i put outside the datatable tags also. It will execute the list datatable first then only route to the link that I clicked. I believe its something similar to this forum. http://forum.java.sun.com/thread.jspa?threadID=534232&messageID=2579716#2579716

Does anyone know any workaround here for this?
Thanks a lot
 
Darryl Nortje
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there Michael,

I don't know of a workaround, I haven't ran into this problem myself. But on the forum topic you linked us to, they mention that it is a bug, and that a simple upgrade to jsf 1.1, or 1.2 will do.

Can you not do that?
 
Andres Quinones
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Always when you make a request in JSF all the components in your page will call the get method for the response. This is because the view state is created in each request, so they need to call the get method each time.
 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently using jboss4.2.2 that comes with latest jsf library. If my list in datatable is too large, when I click a link it will load the whole list again before proceeding to the page link. It will impact on the performance cause have to wait quite a while before loading of list is completed. Not sure whether this is a bug or just how jsf works.
 
Venkat Sadasivam
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use <t:dataTable preserveDataModel="true"> with preserveDataModel attribute to avoid reloading during restore view phase.

http://myfaces.apache.org/tomahawk/extDataTable.html
 
Andres Quinones
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For this you have 3 options:

1- To have your JSF Bean in session in order that the data is stored and you have to make 1 query to the database.

2- You can create an scrollable table in order that you have to query only the items for each page of the table.

3- As Venkat told you preserve the data for each request using Tomahawk or also Richfaces has something like that.
[ July 10, 2008: Message edited by: Andres Quinones ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!