Craig McClanahan schrieb:
On 2/11/07, Ingo Düppe <[EMAIL PROTECTED]> wrote:
Hi,

I wonder if shale should support an out semantic like in shale.
I presume you mean like in Seam? :-)
Yes, you are right, just got mixed up :-)
That would indeed be an interesting approach. One of the things I would
like to see Shale do in the future is be an implementation of JSR-299
(WebBeans), and it wouldn't surprise me at all to see this concept be
included there.

In the mean time, I've found it useful to use the saveData() and
restoreData() methods in the AbstractViewController base class to save and restore state information across requests (it saves the state in a generic
attribute on the UIViewRoot, so JSF's state machinery does the heavy
lifting. You could simulate injection and outjection pretty easily with one
liners:

   public void preprocess() {
       setValue("#{sessionScope.enrollment}", restoreData("enrollment"));
       // May need conditional logic here if it won't always exist
   }

   public void prerender() {
       saveData("enrollment", getValue("#{sessionScope.enrollment}"));
   }

This also works to save variables local to the current view (sort of like
"flash scope" when you are redisplaying the same page).  It can also be
combined with the normal injection that JSF supports on managed beans to
initialize local (to your view controller bean) references to session or
application scope objects.

Craig

This sound interesting,  I will give it a look.

Thx
Ingo



Reply via email to