views:

27

answers:

1

I am using composite components in my JSF 2.0 project, and I want to combine my composite components with like this:

<ex:mycompositecomponent>
    <f:ajax event="change" render="anotherComponent" />
</ex:mycompositecomponent>

Is there any way to do that?

Yours sincerely

Jonathan Frank

A: 

Should be.

The following code is worth the try:

<!-- mycompositecomponent.xhtml -->
    ...
    <composite:implementation>
      <h:inputText ...>
        <composite:insertChildren /> <!-- contents within <ex:mycompositecomponent>...</ex:mycom....> goes here -->
      </h:inputText>
    </composite:implementation>
    ...

Now your usage of mycompositecomponent.xhtml should work.

Babu
What if he wanted to add multiple AJAX-handlers to multiple places inside the composite component?
Tuukka Mustonen