• 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

Problem with datatable update

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, I'm pretty new to JSF, but here's my question:

I have a datatable in which I have a column where each row contains a selectOneMenu. So, the initial value of each menu I take from the database. When the user selects a new value, i want that row to update to take on the new value. I have an a4j:support tag with event="onChange", but when user selects a row, every row in the datatable takes the value they selected for that one row! Do I need to bind my datatable to my backing bean somehow? Here's some code:



For example, if i have a column where the roles for each row are : employee,manager,employee. If the user changes the 3rd row to a developer, then when the I debug the bean.updateRoles method, the roles have been submitted as a developer for all 3 rows, instead of just the 3rd one! Any ideas? I don't have any bindings...
 
Demarcus Smith
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone have any idea on this? Do you need more code?
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you will have to bind your datatable , then in your action event listener, get the current row data and change it.
Do not forget to reRender your table.
reply
    Bookmark Topic Watch Topic
  • New Topic