Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sort dataTable & inputText  RSS feed

 
Tammy Easterby
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've got a data table where you can sort by header. Inside the table the user can update a field on each record. Here's the problem: The sorting works if you're just going to sort, but not input any data. The input box works fine if you're not going to sort! If you try to sort AND input data - the input box only remembers which row number it was applied to, not the bean (data) within the row.

Has anyone out there successfully implemented anything like what I've described?

Thanks!
 
Marcel Frehner
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you've got to submit it first in order to update the backing bean for your table. Check whether the values you enter into your text fields get updated in the corresponding Bean. The sorting probably happens server-side, doesn't it?
 
Tammy Easterby
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is being submitted first. And the sorting does happen on the server side. When I check to see if the values entered into the text fields match the corresponding bean, I see that the values entered match the order of the beans that are initially displayed on the screen, not what is *actually* displayed on the screen. It shouldn't matter that the values entered in the box are maintained in memory, and not in the database, right? Or do I need to be running some kind of "update" method to "save" the screen in JSF?
 
Ravindra Rawat
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope i have understood the problem correctly. Assuming you are using myfaces impl.

My faces impl provided a "preserveDataModel" to control invocation of value binding for the component every time table is rendered.

Thanks
Ravindra S. Rawat
 
Tammy Easterby
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I am using a plain old JSF dataTable. I am not familiar with MyFaces. My list of beans is somehow not linking up with the Data Graph... maybe. Not sure. Any further help would be greatly appreciated.
[ February 02, 2007: Message edited by: Tammy Easterby ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!