2009/5/24 Jim Driscoll <span dir="ltr">&lt;<a href="mailto:Jim.Driscoll@sun.com">Jim.Driscoll@sun.com</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 5/24/09 8:39 PM, David Geary wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
And that id is *exactly* what &lt;f:ajax&gt; says it cannot find. It&#39;s in the<br>
page, but &lt;f:ajax&gt; cannot find it?!?<br>
<br>
My guess is that &lt;f:ajax&gt; is evaluating the id before the page is<br>
completely constructed, and therefore, it doesn&#39;t find it, but that&#39;s<br>
just a WAG on my part.<br>
<br>
So, if this is not correct:<br>
<br>
&lt;f:ajax render=&quot;#{cc.parent.clientId}:image&quot;/&gt;<br>
<br>
Then how do I access the image in the parent (map) component?<br>
<br>
It seems to me that I&#39;m using &lt;f:ajax&gt; correctly, but I&#39;d be happy to be<br>
told otherwise.<br>
</blockquote>
<br>
<br></div>
It&#39;s late, but yes, that looks correct, and yes, your guess sounds correct.  Could you file this as an impl bug?</blockquote><div><br>Okay. I&#39;ll send a WAR to Ryan, and see if we can get this fixed asap. I&#39;d like to get this working for my J1 demo.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Now, we do need to fix that as a bug, but I must argue that your use case represents bad practice.  Your component is using ajax inside a component to modify the using page.  That&#39;s difficult to maintain, and I suspect it will lead to obfuscated code quite easily.  I&#39;d instead argue that if you are going to have one component modify another, you should either group them into one composite, or, have the ID of the component you act upon passed in as an attribute (say &quot;for=&quot;?)</blockquote>
<div><br>Yup, I concur--too much coupling between parent and child components. Unfortunately, I can&#39;t seem to pass the component ID to the child component either. IOW, this doesn&#39;t work:<br><br>In parent component:<br>
<br>  &lt;places:mapZoomControl componentToRender=&quot;#{cc.clientId}:image&quot;/&gt;<br><br>And in mapZoomControl.xhtml:<br><br>  &lt;composite:attribute name=&quot;componentToRender&quot;/&gt;<br>  ...<br>  &lt;f:ajax render=&quot;#{cc.attrs.componentToRender}&quot;/&gt;<br>
<br>I suppose it&#39;s not surprising that the preceeding doesn&#39;t work--it looks like a manifestation of the same bug. I&#39;ll give Ryan a buzz.<br><br>Thanks,<br><br><br>david<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Of course, that second usage suggestion opens up another hole in the cc api - the lack of ability to do name resolution.  Though if/when we get method parameters, then cc.findComponent will work, I guess.    Though I&#39;ve been saying that for a pretty long time now, I should check on when we&#39;re getting those method params...<br>
<font color="#888888">
<br>
Jim<br>
</font></blockquote></div><br>