2009/5/24 Dan Allen <dan.j.allen@gmail.com>

All I've done is cut the zoom prompt and menu from the original file, and pasted it into zoomLevelControl.xhtml.

However, now when I change the zoom level menu, I get an error:

    <f:ajax> contains an unknown id 'image'

According to the AjaxBehaviorRenderer:

  * Attempt to find the component assuming the ID is relative to the
  * nearest naming container.  If not found, then search for the component
  * using an absolute component expression.

My guess is that the components within the composite component are considered to be within a naming container, isolating them from your image component. The strange part, though, is that the composite component is not acting like a naming container as I observed. To fix your problem w/ the current implementation, you have to use an absolute id to the image component (I would guess). But yeah, this is a very confusing situation for developers.

Even that doesn't seem to work. I loaded the page and copied the absolute id, like this:

  <f:ajax render="form:j_id1186681689_16ef8569:0:j_id1186681689_16ef8513:j_id-1105909415_41ead6fe:image"/>

And I receive this ugliness for my trouble:

<f:ajax> contains an unknown id 'form:j_id1186681689_16ef8569:0:j_id1186681689_16ef8513:j_id-1105909415_41ead6fe:image'

Frankly, for JSF 2.1, I would like to see us go to an XPath-like syntax (or jQuery) to find components because component IDs in JSF just plain suck.

Yup, I agree wholeheartedly, but we need to make it easy to do Ajax rendering across composite components for JSF 2.0. IMO, composite components are by far the single most kickass feature of JSF 2, and if they're crippled, we're gonna get some bad press.



Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action


NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.