<br><br><div class="gmail_quote">On Wed, Sep 9, 2009 at 12:33 AM, Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com">lincolnbaxter@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  
  

<div>
One more issue I&#39;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>
</div></blockquote><div><br>They&#39;re fired after the Process Validations phase (or Apply Request Values if immediate=true), which always occurs before the Update Model phase. The idea is that the input must be in a valid state before the model is updated.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><font color="#888888">
<br>
--Lincoln</font><div class="im"><br>
<br>
On Tue, 2009-09-08 at 09:59 -0700, Ryan Lubke wrote:
</div><div><div></div><div class="h5"><blockquote type="CITE">
<pre>On 9/7/09 6:06 PM, Andy Schwartz wrote:
&gt; Thanks Lincoln.  I haven&#39;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&#39;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&#39;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&#39;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" target="_blank">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" target="_blank">http://www.w3.org/1999/xhtml</a>&quot;
&gt;&gt; xmlns:h=&quot;<a href="http://java.sun.com/jsf/html" target="_blank">http://java.sun.com/jsf/html</a>&quot;
&gt;&gt; xmlns:f=&quot;<a href="http://java.sun.com/jsf/core" target="_blank">http://java.sun.com/jsf/core</a>&quot;
&gt;&gt; xmlns:a=&quot;<a href="http://java.sun.com/jsf/composite/ajax" target="_blank">http://java.sun.com/jsf/composite/ajax</a>&quot;
&gt;&gt; xmlns:cc=&quot;<a href="http://java.sun.com/jsf/composite" target="_blank">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" target="_blank">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" target="_blank">http://www.w3.org/1999/xhtml</a>&quot;
&gt;&gt; xmlns:c=&quot;<a href="http://java.sun.com/jsp/jstl/core" target="_blank">http://java.sun.com/jsp/jstl/core</a>&quot;
&gt;&gt; xmlns:f=&quot;<a href="http://java.sun.com/jsf/core" target="_blank">http://java.sun.com/jsf/core</a>&quot;
&gt;&gt; xmlns:h=&quot;<a href="http://java.sun.com/jsf/html" target="_blank">http://java.sun.com/jsf/html</a>&quot;
&gt;&gt; xmlns:socialpm=&quot;<a href="http://java.sun.com/jsf/composite/socialpm" target="_blank">http://java.sun.com/jsf/composite/socialpm</a>&quot;
&gt;&gt; xmlns:pretty=&quot;<a href="http://ocpsoft.com/prettyfaces" target="_blank">http://ocpsoft.com/prettyfaces</a>&quot;
&gt;&gt; xmlns:ui=&quot;<a href="http://java.sun.com/jsf/facelets" target="_blank">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" target="_blank">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" target="_blank">http://ocpsoft.com</a>&gt;
&gt;&gt; Author of PrettyFaces &lt;<a href="http://ocpsoft.com/prettyfaces" target="_blank">http://ocpsoft.com/prettyfaces</a>&gt; URL Rewriting 
&gt;&gt; for JSF
&gt;&gt;
&gt;&gt;
&gt;

</pre>
</blockquote>
</div></div><table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td>
--<div class="im"><br>
<b>Lincoln Baxter, III</b><br>
Co-Founder of <a href="http://ocpsoft.com" target="_blank">OcpSoft</a><br></div><div class="im">
Author of <a href="http://ocpsoft.com/prettyfaces" target="_blank">PrettyFaces</a> URL Rewriting for JSF<br>
<br>
<br>
</div></td>
</tr>
</tbody></table>
</div>

</blockquote></div><br>