Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

boolean property in dataTable

 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic