dev@javaserverfaces.java.net

Re: Review:revert to old listener restore mechanism

From: Ed Burns <ed.burns_at_sun.com>
Date: Wed, 18 May 2005 08:33:19 -0700

>>>>> On Wed, 18 May 2005 07:37:55 -0700, Ed Burns <Ed.Burns_at_Sun.COM> said:

>>>>> On Tue, 17 May 2005 14:58:15 -0700, Jayashri Visvanathan <Jayashri.Visvanathan_at_Sun.COM> said:
JV> Hi Jocob,
JV> The problem with the existing logic is as I had mentioned in the change
JV> bundle, if there are any transient listeners, they will be lost if the
JV> persisted listeners list overrides the internal list. Thats why we are
JV> reverting back to the old way.

EB> We need to put this question to the EG.

Actually, when I sat down to write a bug report for this I discovered
that this isn't a spec issue and we can change it without changing how
we restore listeners.

Here's the deal.

The inner listener added by the PaneComponent is transient, therefore,
it must not be saved or restored. What's happening is that a
StateHolderSaver instance *is* getting created for each inner listener:
with a null state. This is what StateHolderSaver does if the component
it is asked to save is transient.

I propose we modify the package private StateHolderSaver class to have
an isTransient() method that we can call so that
UIComponentBase.saveAttachedState() can skip adding that element if it
is transient, rather than doing the unconditional add we have right now.

Jayashri, can you produce a patch and test this out? I'm concerned
about regressions with this, but I think we'll be ok.

Ed

-- 
| ed.burns_at_sun.com  | {home: 407 869 9587, office: 408 884 9519 OR x31640}
| homepage:         | http://purl.oclc.org/NET/edburns/
| aim: edburns0sunw | iim: ed.burns_at_sun.com