<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
One more issue I'd like to bring up: it appears that when using &lt;f:valueChangeListener action=&quot;...&quot; /&gt; the value of the object provided has not yet been updated in the model, hence, the value is the old value, not the new value.<BR>
<BR>
When using &lt;f:actionListener&gt; on the button submitting the values, the new value is populated into the model instead... which is the behavior I would expect.<BR>
<BR>
Pardon the probably obvious question...<BR>
<BR>
Is there an contract with valueChangeListeners that states they fire before model updates? I see in the spec that it fires: &quot;when a new local value has been created, and has passed all validations,&quot; but nothing about if the model has been updated or not.<BR>
<BR>
--Lincoln<BR>
<BR>
On Tue, 2009-09-08 at 09:59 -0700, Ryan Lubke wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On 9/7/09 6:06 PM, Andy Schwartz wrote:
&gt; Thanks Lincoln.  I haven't had time to debug this, but I have a theory 
&gt; about what might be happening.  In your sample:
&gt;
&gt;&gt; &lt;a:editText value=&quot;#{cc.attrs.task.text}&quot; 
&gt;&gt; rendered=&quot;#{!cc.attrs.disabled}&quot;&gt;
&gt;&gt; *&lt;f:actionListener for=&quot;submit&quot; 
&gt;&gt; action=&quot;#{taskController.saveTaskAjax(cc.attrs.story, 
&gt;&gt; cc.attrs.task)}&quot; /&gt; *
&gt;&gt; &lt;/a:editText&gt;
&gt;
&gt; We expect &quot;cc&quot; to resolve to the containing composite component (ie. 
&gt; to the &lt;socialpm:taskBlock&gt; component).  I wouldn't be surprised if 
&gt; what is actually happening is that &quot;cc&quot; is  being resolved to the 
&gt; &lt;a:editText&gt; composite component instead.
Yep, that's what is happening.
&gt; One reason why I suspect this might be happening is that I know that 
&gt; Ryan has investigated/resolved similar problems not too long ago.
The problem we resolved was the passing of #{cc.attrs} attributes 
between nested composite components.
For this case, the spec recommends using cc.parent.attrs.story and 
cc.parent.attrs.task, where parent resolves
to the nearest composite component parent of the current composite 
component.
&gt; Another reason why I am suspicious about this is because we have faced 
&gt; similar issues in our own (ADF Faces) declarative component solution.  
&gt; This stuff can get tricky. :-)
&gt;
&gt; Hey Ryan -
&gt;
&gt; Does this problem look familiar?  Any thoughts on this?
&gt;
&gt; Andy
&gt;
&gt; Lincoln Baxter, III wrote:
&gt;&gt; Hey Andy, here you go:
&gt;&gt;
&gt;&gt; In the mean time I'm going to sign up for the dev lists.
&gt;&gt;
&gt;&gt; ----------------------------------------------------------------------
&gt;&gt; Using:
&gt;&gt; &lt;f:actionListener for=&quot;submit&quot; 
&gt;&gt; action=&quot;*#{taskController.saveTaskAjax(cc.attrs.story, 
&gt;&gt; cc.attrs.task)}*&quot; /&gt;
&gt;&gt;
&gt;&gt;     *#{taskController.saveTaskAjax(cc.attrs.story, cc.attrs.task)}* =
&gt;&gt;     null values passed to method
&gt;&gt;     *#{taskController.saveTaskAjax(currentStoryBean.story, task)}* =
&gt;&gt;     correct values resolved, assuming currentStoryBean.story and task
&gt;&gt;     are both in the EL/page scope somewhere.
&gt;&gt;
&gt;&gt;
&gt;&gt; ----------------------------------------------------------------------
&gt;&gt; *CC Impl:*
&gt;&gt;
&gt;&gt;
&gt;&gt; &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&gt;&gt;         &quot;<A HREF="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</A>&quot;&gt;
&gt;&gt; &lt;html xmlns=&quot;<A HREF="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>&quot;
&gt;&gt; xmlns:h=&quot;<A HREF="http://java.sun.com/jsf/html">http://java.sun.com/jsf/html</A>&quot;
&gt;&gt; xmlns:f=&quot;<A HREF="http://java.sun.com/jsf/core">http://java.sun.com/jsf/core</A>&quot;
&gt;&gt; xmlns:a=&quot;<A HREF="http://java.sun.com/jsf/composite/ajax">http://java.sun.com/jsf/composite/ajax</A>&quot;
&gt;&gt; xmlns:cc=&quot;<A HREF="http://java.sun.com/jsf/composite">http://java.sun.com/jsf/composite</A>&quot;&gt;
&gt;&gt; &lt;cc:interface&gt;
&gt;&gt; &lt;cc:attribute name=&quot;story&quot; required=&quot;true&quot; type=&quot;Object&quot; /&gt;
&gt;&gt; &lt;cc:attribute name=&quot;task&quot; required=&quot;true&quot; type=&quot;Object&quot; /&gt;
&gt;&gt; &lt;cc:attribute name=&quot;disabled&quot; required=&quot;false&quot; type=&quot;Boolean&quot; 
&gt;&gt; default=&quot;false&quot; /&gt;
&gt;&gt; &lt;cc:insertChildren /&gt;
&gt;&gt; &lt;/cc:interface&gt;
&gt;&gt;
&gt;&gt; &lt;cc:implementation&gt;
&gt;&gt; &lt;h:outputStylesheet name=&quot;socialpm/socialpm.css&quot; /&gt;
&gt;&gt; &lt;h:panelGroup id=&quot;taskBlock&quot; layout=&quot;block&quot; class=&quot;box-bordered p5 
&gt;&gt; #{cc.attrs.styleClass} taskBlock_#{cc.attrs.task.status}&quot; 
&gt;&gt; style=&quot;#{cc.attrs.style}&quot;&gt;
&gt;&gt;
&gt;&gt; &lt;div class=&quot;m5l&quot; style=&quot;margin-right: 25px;&quot; &gt;
&gt;&gt; &lt;h:outputText value=&quot;#{cc.attrs.task.text}&quot; 
&gt;&gt; rendered=&quot;#{cc.attrs.disabled}&quot;/&gt;
&gt;&gt; &lt;a:editText value=&quot;#{cc.attrs.task.text}&quot; 
&gt;&gt; rendered=&quot;#{!cc.attrs.disabled}&quot;&gt;
&gt;&gt; *&lt;f:actionListener for=&quot;submit&quot; 
&gt;&gt; action=&quot;#{taskController.saveTaskAjax(cc.attrs.story, 
&gt;&gt; cc.attrs.task)}&quot; /&gt; *
&gt;&gt; &lt;/a:editText&gt;
&gt;&gt; &lt;/div&gt;
&gt;&gt; &lt;/cc:implementation&gt;
&gt;&gt; &lt;/html&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; ----------------------------------------------------------------------
&gt;&gt; *consuming page code:* &lt;-- this is where task is defined in the 
&gt;&gt; UI:Repeat, so it is in scope
&gt;&gt;
&gt;&gt; &lt;!DOCTYPE html
&gt;&gt;       PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&gt;&gt;       &quot;<A HREF="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</A>&quot;&gt;
&gt;&gt; &lt;html xmlns=&quot;<A HREF="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>&quot;
&gt;&gt; xmlns:c=&quot;<A HREF="http://java.sun.com/jsp/jstl/core">http://java.sun.com/jsp/jstl/core</A>&quot;
&gt;&gt; xmlns:f=&quot;<A HREF="http://java.sun.com/jsf/core">http://java.sun.com/jsf/core</A>&quot;
&gt;&gt; xmlns:h=&quot;<A HREF="http://java.sun.com/jsf/html">http://java.sun.com/jsf/html</A>&quot;
&gt;&gt; xmlns:socialpm=&quot;<A HREF="http://java.sun.com/jsf/composite/socialpm">http://java.sun.com/jsf/composite/socialpm</A>&quot;
&gt;&gt; xmlns:pretty=&quot;<A HREF="http://ocpsoft.com/prettyfaces">http://ocpsoft.com/prettyfaces</A>&quot;
&gt;&gt; xmlns:ui=&quot;<A HREF="http://java.sun.com/jsf/facelets">http://java.sun.com/jsf/facelets</A>&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
&gt;&gt;
&gt;&gt; &lt;ui:composition&gt;
&gt;&gt; &lt;h:form id=&quot;tasksForm&quot;&gt;
&gt;&gt; &lt;c:if test=&quot;#{empty currentStoryBean.story.tasks}&quot;&gt;
&gt;&gt; &lt;div class=&quot;m5&quot;&gt;This story has no tasks. That could be a problem 
&gt;&gt; later...&lt;/div&gt;
&gt;&gt; &lt;/c:if&gt;
&gt;&gt;
&gt;&gt; &lt;ui:repeat value=&quot;#{currentStoryBean.story.tasks}&quot; var=&quot;task&quot;&gt;
&gt;&gt; &lt;socialpm:taskBlock task=&quot;#{task}&quot; story=&quot;#{currentStoryBean.story}&quot;
&gt;&gt; members=&quot;#{currentProjectBean.project.activeMembers}&quot;
&gt;&gt; disabled=&quot;#{!authorizationBean.isMember or 
&gt;&gt; !currentStoryBean.story.open}&quot;
&gt;&gt; deletable=&quot;true&quot; styleClass=&quot;m5t&quot; refreshOnSave=&quot;false&quot; /&gt;
&gt;&gt; &lt;/ui:repeat&gt;
&gt;&gt; &lt;/h:form&gt;
&gt;&gt; &lt;/ui:composition&gt;
&gt;&gt; &lt;/html&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; On Sat, 2009-09-05 at 15:23 -0400, Andy Schwartz wrote:
&gt;&gt;&gt; Hey Lincoln -
&gt;&gt;&gt;
&gt;&gt;&gt; Lincoln Baxter, III wrote:
&gt;&gt;&gt; &gt; First, please let me know if there is a better place to ask JSF 
&gt;&gt;&gt; Dev &gt; related questions.
&gt;&gt;&gt; &gt;
&gt;&gt;&gt;
&gt;&gt;&gt; I suppose the Mojarra dev list might be the right place for 
&gt;&gt;&gt; implementation questions:
&gt;&gt;&gt;
&gt;&gt;&gt; <A HREF="https://javaserverfaces.dev.java.net/mailinglists.html">https://javaserverfaces.dev.java.net/mailinglists.html</A>
&gt;&gt;&gt;
&gt;&gt;&gt; Though personally I am fine with you asking here. :-)
&gt;&gt;&gt;
&gt;&gt;&gt; Could you send along your composite component implementation (and 
&gt;&gt;&gt; perhaps a snippet from the consuming page)?  Just want to make sure 
&gt;&gt;&gt; I understand the use case.
&gt;&gt;&gt;
&gt;&gt;&gt; Andy
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt; -- 
&gt;&gt; *Lincoln Baxter, III*
&gt;&gt; Co-Founder of OcpSoft &lt;<A HREF="http://ocpsoft.com">http://ocpsoft.com</A>&gt;
&gt;&gt; Author of PrettyFaces &lt;<A HREF="http://ocpsoft.com/prettyfaces">http://ocpsoft.com/prettyfaces</A>&gt; URL Rewriting 
&gt;&gt; for JSF
&gt;&gt;
&gt;&gt;
&gt;

</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
--<BR>
<B>Lincoln Baxter, III</B><BR>
Co-Founder of <A HREF="http://ocpsoft.com">OcpSoft</A><BR>
Author of <A HREF="http://ocpsoft.com/prettyfaces">PrettyFaces</A> URL Rewriting for JSF<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>