• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

InputText in DataTable does not store value

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the problem, that I am using a dataTable from tomahawk for iterating an List:





The update I made in the inputtext is not represented in the List.

What is the problem, when I save with the button, that my object model is not filled (by using setters) ?
In Debug mode I can see that a new instance is using my setters.
Therefore the different instances causes the problem, that I have to use the binding.
Any explaination for me?

Because I didn't find an answer for my question, I tried to use a binding as mentioned above.
But there is no updated data in the List. Can anyone help me?
Thanks,
Klaus

PS: Related Article: Same Problem in another code ranch article
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to access the 'populatedFoos' property in the action method. The updated model values are in there. You should also rather populate the list in the constructor of the backing bean. A getter can be called more than once in bean's life and is in fact solely intented to return a bean property, not to do some (non-lazy) loading actions. After all you need to ensure that the same list is constructed during the apply request values phase of the subsequent request as it was during the render response phase of the initial request. If the bean is request scoped (good choice) and you want to prevent the datamodel being loaded everytime, you can use preserveDataModel attribute of the t:dataTable for this.

You may find the examples in this article useful as well: http://balusc.blogspot.com/2006/06/using-datatables.html
 
Klaus Schuster
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My Code now looks like this:

I am using the session scope, and when I check the 'popultedFoos' Variable, no update is made after clicking the save button.
In the updatedFooList there is also the old value...
I don't know where the problem is located.
 
Klaus Schuster
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, everything works with an List. I thought i am using a list for my value in the datatable.
But it was a map. (values of map) which has shown me the data, but couldn't use any setter at the storing process...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic