incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renzo Tomaselli <renzo.tomase...@tecnotp.it>
Subject Re: [Trinidad] using t:saveState
Date Thu, 21 Dec 2006 08:30:47 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1">Great, Adam.<br>
Now boh state restoring and h:commandButton work fine.<br>
Thanks -- Renzo<br>
</font><br>
Adam Winer wrote:
<blockquote
 cite="mid6dac79b90612202157m50b9f3f5o80a87dbb0e3998f0@mail.gmail.com"
 type="cite">YIKES!&nbsp; Thanks for pointing that glitch out.&nbsp; *Fixed*.
  <br>
  <br>
Thanks,
  <br>
Adam
  <br>
  <br>
  <br>
On 12/20/06, Renzo Tomaselli <a class="moz-txt-link-rfc2396E" href="mailto:renzo.tomaselli@tecnotp.it">&lt;renzo.tomaselli@tecnotp.it&gt;</a>
wrote:
  <br>
  <blockquote type="cite">After some debugging, I noticed that the
suggested parameter cannot
    <br>
work, since we have (in StateManagerImpl.saveSerializedView()):
    <br>
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // FIXME: pageState is never
read
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PageState pageState
= new PageState(
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
context,
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
structure,
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
state,
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// Save the view root into the page state as a transient
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// if this feature has not been disabled
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
_useViewRootCache(context) ? root : null);
    <br>
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; token = cache.addNewEntry(new
PageState(context, structure,
    <br>
state, root),
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
stateMap);
    <br>
    <br>
thus a valid root to cache is always passed in to PageState
constructor,
    <br>
no matter the value of useViewRootCache, which is set according to the
    <br>
parameter.
    <br>
Indeed the FIXME says all.
    <br>
-- Renzo
    <br>
    <br>
Renzo Tomaselli wrote:
    <br>
&gt; Matthias, I placed the param below at the beginning of web.xml,
but
    <br>
&gt; things run as before, e.g. viewState.popRoot(context) gets called
    <br>
&gt; while restoring every view.
    <br>
&gt; I could not spot where this caching optimization should depend on
a
    <br>
&gt; parameter.
    <br>
&gt; Where can I control that flag from sources and how can I turn
Trinidad
    <br>
&gt; logging to a finer grain ?
    <br>
&gt; Btw, I noticed another misbehavior which might be related to wrong
    <br>
&gt; view caching. I have a page with a section which is rendered
according
    <br>
&gt; to a show/hide button.
    <br>
&gt; It happens sometime that - with details hidden - bean setters are
    <br>
&gt; called for actually unrendered&nbsp; components, much like having a
    <br>
&gt; mismatch between actual view and the cache.&nbsp; New value passed in
is
    <br>
&gt; null&nbsp; though,&nbsp; hence&nbsp; quite a number of troubles.
    <br>
&gt; -- Renzo
    <br>
&gt;
    <br>
&gt; Matthias Wessendorf wrote:
    <br>
&gt;&gt; Adam,
    <br>
&gt;&gt;
    <br>
&gt;&gt; can you nail that to tomahawks jira?
    <br>
&gt;&gt;
    <br>
&gt;&gt; thx,
    <br>
&gt;&gt;
    <br>
&gt;&gt;
    <br>
&gt;&gt; On 12/20/06, Adam Winer <a class="moz-txt-link-rfc2396E" href="mailto:awiner@gmail.com">&lt;awiner@gmail.com&gt;</a>
wrote:
    <br>
&gt;&gt;&gt; A magic configuration option should solve the problem
    <br>
&gt;&gt;&gt;
    <br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;context-param&gt;
    <br>
&gt;&gt;&gt;
    <br>
&gt;&gt;&gt;
&lt;param-name&gt;org.apache.myfaces.trinidad.CACHE_VIEW_ROOT&lt;/param-name&gt;
    <br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;param-value&gt;false&lt;/param-value&gt;
    <br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/context-param&gt;
    <br>
&gt;&gt;&gt;
    <br>
&gt;&gt;&gt; The optimization in StateManagerImpl is very significant,
but it
    <br>
&gt;&gt;&gt; *does* break t:saveState - since when it is in effect, we
can skip
    <br>
&gt;&gt;&gt; processRestoreState() altogether.&nbsp; It'd be a Good Thing
if
t:saveState
    <br>
&gt;&gt;&gt; was able to deal with StateManagers that include this
optimization.
    <br>
&gt;&gt;&gt;
    <br>
&gt;&gt;&gt; -- Adam
    <br>
&gt;
    <br>
    <br>
  </blockquote>
  <br>
  <br>
</blockquote>
</body>
</html>

Mime
View raw message