Greetings,
I am facing some really odd behavior. Maybe this is normal.I have a
dataTable that calls a method named getCategories
(value="#{myBackingBean.categories}") for it's collection. I also bind
to a UITable (binding="#{myBackingBean.categoryData}") so that i can
use the getRowData on the UIData and determine which row was selected
when using a <h:linkCommand>. This allows me to display a detail page
of the selected item.
When i set my debugger to break on the getCategories method it starts
out calling it 1 time when the list is initially displayed. This is
expected because i only call the method from the page.
Once i click the detail link it accesses it 2 times. The first call I
assumingly attribute to the getRowData needing to retrieve the
collection to grab the object at a specified index. The second call i
attribute to the value attribute of the dataTable tag calling the
collection for display.
Once i return back to the original page the getCategories method gets
called 3 times. This is really bizzare. I would expect it to only be
called 1 time because i am not selecting a row or a command link that
accesses the collection. I am simply displaying a list. What is going
on?
I have my backing bean managed in request scope and the getCategories
method makes a call to the service layer to retrieve the list each
time. So, this could get quite expensive. I also do not want to get in
the habit of putting a list on my backing bean and storing it in
session. That would begin to crete some nasty memory usage for
sessions when user load grows.
I'd appreciate any insight and help.
Much appreciation.
Brandon