At first I thought prerender would be really cool, and I'm sure in some
cases it is, but I still find myself writing "prepareForSearch" or
"prepareForEdit" methods. To make it makes sense to have those kind of
methods in backing beans for your commandLinks or buttons on menus to
call. The reason I feel this way is....
1) If using setUp/prepare method calls, it make sense when reading the
code what is going to happen. If I see the link call that method I can
tell exactly at a glance what is going to happen. (Granted it's not that
difficult to look inside the backing bean see that a prerender is in there.)
2) More importantly, setup/prepare methods allow for multiple setUps for
a backing bean. What if when going to an "EmployeeAction" as a backing
bean that you need to prepare a search screen that is completely
different when searching for a "domestic" employee versus an "abroad"
employee? To handle setting up different types of pages with a prerender
looks like it would involve logic within the prerender method (pull some
kind of requesst variables which is ugly enough to do in JSF) or you
would have to create multiple types of Actions. Whereas doing things
without the prerender you can have "prepareDomesticSearch"
"prepareForeignSearch" methods in the same bean.
3) Lastly I'm not so sure I always want the prerender method being
called. For example if I'm using the same backingBean for genearating a
list of employees and for setting up an edit page, what would the
prerender actually setup and would I want it always firing?
Using prerender only seems to make sense in light of very specific
backing beans that are always going to behave in the same fashion.
I could be very well way off-base so I'd be interested in other comments.
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]