Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

boolean property in dataTable

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

I am new to JSF, so take it easy ok? After a lot of thinking, tips and checking out threads like this one approaching a similar situation, I have this scenario:
I have a managed bean named PersonNav used to navigate in session scope. It stores a list of objects which I display with a dataTable. Each object of the list has a 'selected' property (boolean), which is rendered with selectBooleanCheckbox. My intention is to modify this property by selecting the checkbox and invoking an action in the same session-scoped PersonNav bean.
The dataTable and commandLink look like this:

The action is executed, but the list is always empty. Looks like PersonNav is re-instantiated or something. Any ideas of how to tackle this down?
Thanks
 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update:
PersonNav is the same instance in both calls (found out using Object.toString() implementation). Now I am really puzzled about the disappearance of 'list'. There is no setter for it (just getter), and the only place where it is instantiated is not executed. Any thoughts?

Update 2:
Although it seems to be the same instance, the constructor of PersonNav is called before each action performed on it (and it has always the same object id). Could it be something related to serialization of the object when it is retrieved from the session?
[ May 11, 2005: Message edited by: Henrique Sousa ]
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By any chance your application running in a distributed environment?
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Henrique Sousa:
There is no setter for it (just getter), and the only place where it is instantiated is not executed. Any thoughts?


Create one setter too.
 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am running everything locally. I just realized I had a filter invalidating the session on every request. Now everything works, thanks
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic